
Python_Ch7_User inputs and testing your code

Quiz
•
Computers
•
Professional Development
•
Medium
Used 2+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default return type of input()?
Integer
String
Float
List
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function is used to take user input in Python?
get()
input()
scan()
read()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you convert the result of input() to an integer in Python?
int(input())
str(input())
float(input())
bool(input())
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does assert do in a test case?
Prints a message
Stores a variable
Defines a loop
Raises an error if a condition is false
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a test case in unittest?
A method that tests a specific functionality
A class attribute
A loop over data
A function that processes input
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you validate that input is not empty?
if input == 0
if input.isalpha()
if input.isdigit()
if input == ""
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a unit test?
A test of user input
A test of the entire program
A test of a specific function or method
A test of a loop
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Java Selenium WebDriver

Quiz
•
Professional Development
12 questions
Week 1

Quiz
•
Professional Development
15 questions
Quiz 3

Quiz
•
Professional Development
15 questions
Scope of Variables in Python

Quiz
•
1st Grade - Professio...
11 questions
Python I

Quiz
•
Professional Development
15 questions
Sains Komputer Tingkatan 5 - 1.3.3 Membina Jadual Kebenaran

Quiz
•
1st Grade - Professio...
20 questions
SLG ULI101 Week 12 - Bash II

Quiz
•
Professional Development
20 questions
SPARK FIDDLE

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
15 questions
Fun Random Trivia

Quiz
•
Professional Development
22 questions
Anne Bradstreet 1612-1672

Quiz
•
Professional Development
18 questions
Spanish Speaking Countries and Capitals

Quiz
•
KG - Professional Dev...
14 questions
Fall Trivia

Quiz
•
11th Grade - Professi...
15 questions
Disney Characters Quiz

Quiz
•
Professional Development
15 questions
Quiz to Highlight Q types & other great features in Wayground

Quiz
•
Professional Development