3.7. Exercises

3-1. Identifiers. Why are variable type declarations not used in Python?

3-2. Identifiers. Why are variable name declarations not used in Python?

3-3. Identifiers. Why should we avoid the use of the underscore to begin variable names with?

3-4. Statements. Can multiple Python statements be written on a single line?

3-5. Statements. Can a single Python statement be written over multiple lines?

3-6. Variable assignment.

(a) Given the assignment x, y, z = 1, 2, 3, what do x, y, and z contain?

(b) What do x, y, and z contain after executing: z, x, y = y, z, x?

3-7. Identifiers. Which of the following are valid Python identifiers? If not, why not? Of the invalid ones, which are keywords?

 int32 40XL char $aving$ printf print _print a do this ...

Get Core Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.