100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Resumen

Information & Data Management: SUMMARY Automate The Boring Stuff with Python

Puntuación
-
Vendido
10
Páginas
24
Subido en
01-09-2019
Escrito en
2018/2019

English summary for the course Information & Data Management of the bachelor Business Administration at the UvA. It includes all the required chapters of 'How to automate the boring stuff with Python' and some additional lecture notes. If you read this you will understand Python and programming way better! :) Following the course outline, this summary includes: Chapters 1 and 2, 3, 4 , 5, 6, 8. Information & Data Management: SUMMARY of the book: Automate The Boring Stuff with Python, ISBN: 9 7815 9327 5990

Mostrar más Leer menos
Institución
Grado










Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Libro relacionado

Escuela, estudio y materia

Institución
Estudio
Grado

Información del documento

¿Un libro?
Desconocido
Subido en
1 de septiembre de 2019
Número de páginas
24
Escrito en
2018/2019
Tipo
Resumen

Temas

Vista previa del contenido

AUTOMATE THE BORING STUFF:
/ CH1 /

A window with the >>> prompt should appear; that’s the interactive shell.

2 + 2 is called an expression: consist of values (such as 2) and operators (such as +),
and they can always evaluate (that is, reduce) down to a single value.

** Exponent 2 ** 3 8

% Modulus/remainder 22 % 8 6

// Integer division/floored quotient 22 // 8 2

Modules/Remainder: divides by whole number (22-(2x8)=6)
Integer division: divides by whole number and deletes any decimals. 22//8=2.75 → = 2

Precedence: the order of operations: ** , *, /, //, % , +, - . Use parentheses ( ) [haakjes] to
override the usual precedence if you need to.

Data type: a category for values, and every value belongs to exactly one data type.
- Integer (int): indicates values that are whole numbers.
- Floating-point (floats): Numbers with a decimal point, such as 3.14. Note that
even though the value 42 is an integer, the value 42.0 would be a floating-point
number.

- Strings: single quote showing where to begin and end.
'a', 'aa', 'aaa', 'Hello!', '11 cats' '' = blank string

When + is used on two string values, it joins the strings as the string
concatenation operator.
>>> 'Alice' + 'Bob'
'AliceBob'
Combining an + operator on a string and an integer value will result in an error.

Combining an * operator on a string value and one integer value = string
replication operator
>> 'Alice' * 5
'AliceAliceAliceAliceAlice'
‘Alice’ * 5.0 would give an error.

Variable: a box in the computer’s memory where you can store a single value (to use later).
1. Only one word.
2. Use only letters, numbers, and the underscore _ character.
3. Can’t begin with a number.
a) Variable names are (capital letter) case-sensitive.

Assignment statement: consists of a variable name, an equal sign (= assignment
operator), and the value (=integer value) to be stored.
>>> spam = 40
>>> eggs = 2
>>> spam + eggs
42

,A variable is initialized the first time a value is stored in it.
Overwriting the variable: When a variable is assigned a new value, the old value is forgotten.
>>> spam = spam + 2
>>> spam
42

File editor: has some specific features for typing in source code.
- The interactive shell window will always be the one with the >>> prompt.
- The file editor window will not have the >>> prompt.

When there are no more lines of code to execute, the Python program terminates (exits);
that is, it stops running.

# is a comment. Python ignores comments (and the blank lines after it), and you can use
them to write notes or remind yourself what the code is trying to do.
Commenting out: Sometimes, programmers will put a # in front of a line of code to temporarily remove it
while testing a program.


The print() function displays the string value inside the parentheses on the screen.
When Python executes a line, you say that Python is calling the print()function and
the string value is being passed to the function. A value that is passed to a function
call is an argument.

The input()function waits for the user to type some text on the keyboard and
press ENTER. Always returns a string (even if the user typed in a number).

print('It is good to meet you, ' + myName)

The len () function: evaluates to the integer value of the number of characters in that
string.
>>> len('hello')
5

The str() function is handy when you have an integer or float that you want to concatenate to a
string.
>>> str(29)
'29'
>>> print('I am ' + str(29) + ' years old.')
I am 29 years old.


The int() function is helpful if you have a number as a string value that you want to
use in some mathematics. Treat variable as an integer instead of a string:
>>> spam = input()
101

>>> spam = int(spam)

>>> spam *
202.0


The int () function is useful if you need to round a floating-point number down. If you
want to round a floating-point number up, just add 1 to it afterward.

2

, >>> int(7.7)
7
>>> int(7.7) + 1
8

An integer can be equal to a floating point, as they’re both numbers (unlike a string, which is
text).
>>> 42 == 42.0
True
>>> 42.0 == 0042.000
True




/ CH2 /

Flow control statements can decide which Python instructions to execute under which
conditions. There is usually more than one way to go from the start to the end.

Boolean data type has only two values: True and False.
>>> spam = True
>>> spam
True


Comparison operators compare two values and evaluate down to a single Boolean value.
Operator Meaning
== Equal to
!= Not equal to
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to

>>> 'dog' != 'cat'
True
>>> 42 == 42.0
True
>>> 42 == '42'
False

>>> eggCount = 42
>>> eggCount <= 42
True

• The == operator (equal to) asks whether two values are the same as each other.
• The = operator (assignment) puts the value on the right into the variable on the
left.




3
$7.85
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
chiara-uva Universiteit van Amsterdam
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
568
Miembro desde
8 año
Número de seguidores
359
Documentos
0
Última venta
10 meses hace

4.2

72 reseñas

5
28
4
35
3
7
2
1
1
1

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