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

Summary Think Python2 Chapter 5

Puntuación
-
Vendido
-
Páginas
7
Subido en
08-10-2018
Escrito en
2018/2019

This is the summary for YOU, if you want to learn the basics of Python quickly. Not everyone has time to read a book of more than 200 pages. That's why I thought, why don't I make a short summary of it! This is a summary of chapter 5 of the book ThinkPython2 (with the exercises!). I can't summarize this book in a day ofcourse so I will keep uploading summaries of the chapters. So don't worry the rest of the chapters will come.

Mostrar más Leer menos
Institución
Grado

Vista previa del contenido

Chapter 5 Conditionals and recursion




The main topic of this chapter is the if statement, which executes different code depending on the
state of the program. But first two new operators are introduced: floor division and modulus.
5.1 Floor division and modulus
The floor division operator (//) divides 2 integers and round down to an integer. Suppose a movie
is 105 minutes. You want to know how many hours that is. A division returns a floating point:
>>> minutes = 105 1.75
>>> minutes / 60
But you want to know it in an integer. Floor division returns the hours in integer, rounding down:
>>> minutes = 105 1
>>> hours = minutes // 60
>>> hours
To get the remainder you use modulus (%) which divides 2 numbers and returns the remainder:
>>> remainder = minutes % 60 45
>>> remainder
You could also use this to check whether a number is divisible by another: if x % y is 0, then x is
divisible by y. Or you could extract the right most digit(s) from a number: x % 10 yields the right-
most digit of x (in base 10). Similarly x % 100 yields the last two digits.
5.2 Boolean expressions

Libro relacionado

Escuela, estudio y materia

Institución
Estudio
Grado

Información del documento

¿Un libro?
No
¿Qué capítulos están resumidos?
Chapter 5
Subido en
8 de octubre de 2018
Número de páginas
7
Escrito en
2018/2019
Tipo
RESUMEN

Temas

$4.15
Accede al documento completo:

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


Documento también disponible en un lote

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.
Yuna429 Hogeschool Rotterdam
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
185
Miembro desde
8 año
Número de seguidores
130
Documentos
38
Última venta
1 año hace

Ik probeer zo goed mogelijk samenvattingen te maken. Hierbij kijk ik naar de informatie die in je boek staat, de opgaven en ik kijk af en toe op internet.

4.2

92 reseñas

5
48
4
23
3
14
2
1
1
6

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