Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Otro

python cheat sheet

Puntuación
-
Vendido
-
Páginas
10
Subido en
03-12-2022
Escrito en
2022/2023

this is full python python cheat sheet by which you can revise all your python syllabus in a day this sheet will help you a lot

Institución
Grado

Vista previa del contenido

Variables .................................................................................................. 5
Comments ................................................................................................. 5
Receiving Input ........................................................................................5
Strings ......................................................................................................6
Arithmetic Operations .............................................................................7
If Statements ............................................................................................8
Comparison operators ............................................................................ 8
While loops ............................................................................................... 8
For loops ...................................................................................................9
Lists ........................................................................................................... 9
Tuples ........................................................................................................9
Dictionaries.............................................................................................10
Functions .................................................................................................10
Exceptions................................................................................................ 11
Classes...................................................................................................... 11
Inheritance .............................................................................................12
Modules ................................................................................................... 12
Packages ..................................................................................................13
Python Standard Library ......................................................................13
Pypi .........................................................................................................14
Want to Become a Python Expert? ........................................................ 14

, Variables
We use variables to temporarily store data in computer’s memory.

price = 10

rating = 4.9

course_name = ‘Python for Beginners’

is_published = True

In the above example,

• price is an integer (a whole number without a decimal point)

• rating is a float (a number with a decimal point)

• course_name is a string (a sequence of characters)

• is_published is a boolean. Boolean values can be True or False.



Comments
We use comments to add notes to our code. Good comments explain the hows and
whys, not what the code does. That should be reflected in the code itself. Use
comments to add reminders to yourself or other developers, or also explain your
assumptions and the reasons you’ve written code in a certain way.

# This is a comment and it won’t get executed.
# Our comments can be multiple lines.



Receiving Input
We can receive input from the user by calling the input() function.

birth_year = int(input(‘Birth year: ‘))

The input() function always returns data as a string. So, we’re converting the
result into an integer by calling the built-in int() function.

Escuela, estudio y materia

Institución
Grado

Información del documento

Subido en
3 de diciembre de 2022
Número de páginas
10
Escrito en
2022/2023
Tipo
OTRO
Personaje
Desconocido

Temas

$8.49
Accede al documento completo:

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Conoce al vendedor
Seller avatar
siddhantyadav

Conoce al vendedor

Seller avatar
siddhantyadav psit che
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
-
Miembro desde
3 año
Número de seguidores
0
Documentos
2
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes