Learn Python in 7 Days
eBook - ePub

Learn Python in 7 Days

Mohit, Bhaskar N. Das

Partager le livre
  1. 280 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Learn Python in 7 Days

Mohit, Bhaskar N. Das

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

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

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Learn Python in 7 Days est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Learn Python in 7 Days par Mohit, Bhaskar N. Das en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming in Python. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
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...

Table des matiĂšres