Learn Python in 7 Days
eBook - ePub

Learn Python in 7 Days

Mohit, Bhaskar N. Das

Buch teilen
  1. 280 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Learn Python in 7 Days

Mohit, Bhaskar N. Das

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Learn efficient Python coding within 7 daysAbout This Book• Make the best of Python features• Learn the tinge of Python in 7 days• Learn complex concepts using the most simple examplesWho This Book Is ForThe book is aimed at aspiring developers and absolute novice who want to get started with the world of programming. We assume no knowledge of Python for this book.What You Will Learn• Use if else statement with loops and how to break, skip the loop• Get acquainted with python types and its operators• Create modules and packages• Learn slicing, indexing and string methods• Explore advanced concepts like collections, class and objects• Learn dictionary operation and methods• Discover the scope and function of variables with arguments and return valueIn DetailPython is a great language to get started in the world of programming and application development. This book will help you to take your skills to the next level having a good knowledge of the fundamentals of Python.We begin with the absolute foundation, covering the basic syntax, type variables and operators. We'll then move on to concepts like statements, arrays, operators, string processing and I/O handling. You'll be able to learn how to operate tuples and understand the functions and methods of lists. We'll help you develop a deep understanding of list and tuples and learn python dictionary. As you progress through the book, you'll learn about function parameters and how to use control statements with the loop. You'll further learn how to create modules and packages, storing of data as well as handling errors. We later dive into advanced level concepts such as Python collections and how to use class, methods, objects in python.By the end of this book, you will be able to take your skills to the next level having a good knowledge of the fundamentals of Python.Style and approachFast paced guide to get you up-to-speed with the language. Every chapter is followed by an exercise that focuses on building something with the language. The codes of the exercises can be found on the Packt website

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Learn Python in 7 Days als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Learn Python in 7 Days von Mohit, Bhaskar N. Das im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Programming in Python. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2017
ISBN
9781787287778

Type Variables and Operators

In the last chapter, you learned a little bit about the history of Python. You learned the steps to install Python and some basic syntax of the language. In the basic syntax, you learned about types of comments that can be used in the code, various types of quotes, escape sequence that can be handy, and finally, you learned about the formatting of strings. In this chapter, you will learn about assignment statements, arithmetic operators, comparison operators, assignment operators, bitwise operators, logical operators, membership operators, and identity operators.

Variables

So, what is a variable? Consider that your house needs a name. You place a nameplate at the front gate of your house. People will now recognize your house through that nameplate. That nameplate can be considered as variable. Like a nameplate points to the house, a variable points to the value that is stored in memory. When you create a variable, the interpreter will reserve some space in the memory to store values. Depending on the data type of the variable, the interpreter allocates memory and makes a decision to store a particular data type in the reserved memory. Various data types, such as integers, decimals, or characters, can be stored by assigning different data types to the variables. Python variables are usually dynamically typed, that is, the type of the variable is interpreted during runtime and you need not specifically provide a type to the variable name, unlike what other programming languages require. There are certain rules or naming conventions for naming variables. The following are the rules:
  • Reserved key words such as if, else, and so on cannot be used for naming variables
  • Variable names can begin with _, $, or a letter
  • Variable names can be in lower case and uppercase
  • Variable names cannot start with a number
  • White space characters are not allowed in the naming of a variable
You can assign values to the variable using = or assignment operator.
Syntax:
 <variable name>= < expression > 

Single assignment

Here, we will illustrate the use of the assignment operator (=) with an example:
 city='London' # A string variable assignment. 
money = 100.75 # A floating point number assignment
count=4 #An integer assignment
In this case, we assigned three d...

Inhaltsverzeichnis