7.1.5: Initials

Question: What is wrong with program KeyboardInput01.py? (input())

Answer: The program doesn’t use input properly because they don’t give the user a prompt

Question: Can you assume that the user will have knowledge of the inner workings of your program?

Answer: no

Question: What is the purpose of using a prompt with input?

Answer: It instructs the user to enter something; the prompt is a string literal parameter of the input command

Question: Can one program input multiple values?

Answer: yes

Question: Look at program KeyboardInput04.py. Why does this program not add the 2 numbers properly? (5

  • 4 = 54)

  • Answer: The program performed concatenation instead of addition because the program tried to add strings

Donation Page

Support Our Work

Do you appreciate the value this website provides? If so, please consider donating to help keep it running. Your donation will go a long way in helping us continue to provide the same quality of content and services. Every bit helps, and your support is greatly appreciated. Thank you for your generosity.