Python Programming Quiz – print() and input() functions 1. What is the correct syntax to display “Hello, World!” in Python? printf("Hello, World!") display("Hello, World!") echo("Hello, World!") print("Hello, World!") 2. How can you prevent the print() function from moving to a new line after output? print("Hello", next=" ") print("Hello", end=" ") print("Hello", skip=" ") print("Hello", stop=" ") 3. Which of the following is used to get user input in Python? input() print() get() output() 4. Which of the following is NOT true about the print() function? It can display text on the screen It is used to take user input It can perform mathematical calculations It can display variable values 5. What will be the output of the following code? print(5 + 3) 53 Error 8 5 + 3 6. How do you display the text: I love Python? print('I love Python') input('I love Python') print(I love Python) display('I love Python') 7. Which of the following statements will produce an error? print("5" + "6") print("Age: " + 25) print("Hello" + "World") print(10 + 20) 8. What will be the output of the following code if the user enters Python? language = input(“Favorite language: “) print(“You like”, language) You like You like Python Python Favorite language: Python 9. What will the following code do? name = input(“Enter your name: “) print(name) Show an error Take user input and display it Print “Enter your name:” only Only take user input without displaying it 10. What is the default end character in the print() function? ; (semicolon) . (dot) \n (newline) , (comma) Loading …