Try out these exercises at home. These are just examples. Try to find some more examples in the internet or just play around!
x
, button4
, 34
, 3e4
, turkey
, $i
, square-root
, readme
, readme.txt
, shorterEdge
, shorter_edge
, NUMBER_OF_POINTS
, _
, π
, True
, _cache
, __name__
, while
.shorterEdge
, shorter_edge
is a more correct name for a variable? Why? Try searching for PEP 8 variable names. What's a PEP 8
?surface
and volume
of a cube
with edge = 2852 cm
.edge
value.Body Mass Index (BMI)
from a user's weight
and height
.
The BMI is a measure of some's weight taking into account their height. e.g. If a tall person and a short person both weigh the same amount, the short person is usually more overweight.
The BMI is calculated by dividing
a person's weight
(in kg) by the square of their height
(in m
).from random import randrange
number = randrange(3)
print(number)