
Python Input Basics Quiz
Authored by Ben Saddington
Fun
8th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What function is used in Python to take input from the user?
`print()`
`input()`
`read()`
`scan()`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to prompt the user for their name in Python?
`name = input("Enter your name: ")`
`name = input("Enter your name")`
`name = input()`
`name = input("Enter your name: ", "Name")`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What data type does the `input()` function return by default?
Integer
Float
String
Boolean
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you convert a user input to an integer in Python?
`int(input())`
`str(input())`
`float(input())`
`bool(input())`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will happen if you try to convert a non-numeric input to an integer using `int(input())`?
It will return 0
It will return an empty string
It will raise a `ValueError`
It will return `None`
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a method to handle errors in Python?
`try-except`
`if-else`
`for-while`
`switch-case`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the `except` block in Python?
To execute code when no errors occur
To execute code when an error occurs
To define a function
To import a module
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
TOUCH with PRULeads
Quiz
•
1st - 10th Grade
20 questions
House Trivia
Quiz
•
6th - 12th Grade
10 questions
Naruto - Uchiha clan dōjutsu
Quiz
•
1st Grade - University
10 questions
Hunter x Hunter Test
Quiz
•
3rd Grade - University
10 questions
KS3 - Fun Computing Quiz 2
Quiz
•
4th - 12th Grade
15 questions
iJSD Logic Questions
Quiz
•
7th - 12th Grade
12 questions
Bible Drill
Quiz
•
2nd Grade - University
15 questions
Quiz Pelatihan Microsoft Word untuk SMP (Teluk Pakedai)
Quiz
•
7th - 9th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade