Python sample question with answer 6
Question:
Which line of code outputs the string "invalid username" to the screen?
- print(invalid username)
- print(#invalid username#)
- # print("invalid username")
- print("invalid username")
Answer:
D - is the correct answer. The print() function outputs the object specified inside the parentheses to the screen. To output a string, it must be placed in quotation marks