Learn Python in 7 Days
eBook - ePub

Learn Python in 7 Days

Mohit, Bhaskar N. Das

Condividi libro
  1. 280 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Learn Python in 7 Days

Mohit, Bhaskar N. Das

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Learn Python in 7 Days è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Learn Python in 7 Days di Mohit, Bhaskar N. Das in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Programming in Python. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2017
ISBN
9781787287778
Edizione
1

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...

Indice dei contenuti