Chapter 2: Problem 30
Type in the following program in a file and check carefully that you have exactly the same spaces: C = -60; dC = 2 while C <= 60: F = (9.0/5)*C + 32 print C, F C = C + dC Run the program. What is the first problem? Correct that error. What is the next problem? What is the cause of that problem? (See Exercise \(2.12\) for how to stop a hanging program.) The lesson learned from this exercise is that one has to be very careful with indentation in Python programs! Other computer languages usually enclose blocks belonging to loops in curly braces, parentheses, or BEGIN-END marks. Python's convention with using solely indentation contributes to visually attractive, easy-to-read code, at the cost of requiring a pedantic attitude to blanks from the programmer.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.