Chapter 2 Elementary Programming
1.
area is 11.0
2.
miles = 100
kilometers = 1.609 * miles
print(kilometers)
The value of kilometers is 160.9.
3.
value = eval(input("Enter a numeric value: "))
4.
It will cause an error. You have to enter a
numeric value.
5.
To break a long line, place the line
continuation symbol (\) at the end of a line to
tell the interpreter that the statement is
continued on the next line.
6.
Valid identifiers: miles, Test, apps, x, y, radius
Invalid identifiers: a+b, b–a, 4#R, $4, #44,
if, elif
Keywords:
if, elif
7.
Use lowercase for variables. If a name consists of several
words, concatenate them into one, making the first word
lowercase and capitalizing the first letter of each subsequent
word—for example, the variables radius, area, and
numberOfStudents.
8.
You should write a = 2