Learn Python in 7 Days
eBook - ePub

Learn Python in 7 Days

Mohit, Bhaskar N. Das

Compartir libro
  1. 280 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Learn Python in 7 Days

Mohit, Bhaskar N. Das

Detalles del libro
Vista previa del libro
Índice
Citas

Información del 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

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Learn Python in 7 Days un PDF/ePUB en línea?
Sí, puedes acceder a Learn Python in 7 Days de Mohit, Bhaskar N. Das en formato PDF o ePUB, así como a otros libros populares de Computer Science y Programming in Python. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2017
ISBN
9781787287778
Edición
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...

Índice