print(), int and input() - Python

Quiz
•
Computers
•
6th - 8th Grade
•
Easy
Chris CHA
Used 1+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is missing from this line of code?
print(Hello world!)
Speech marks!
print("Hello world!")
Capital P!
Print(Hello world!)
Space before brackets!
print (Hello world)
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is wrong with this line of code?
(print "how tall are you?")
Needs another pair of brackets
(print("how tall are you?"))
Remove outside brackets, surround text with brackets instead:
print("how tall are you?")
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What needs correcting in this line of code?
print('Goodbye world!')
Add an extra space after print
print ('Goodbye world!')
Single quotes should be double quotes
print("Goodbye world!")
Remove exclamation mark
print('Goodbye world')
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What needs to be fixed in this line of code?
print(3 + 5 =, 3 + 5)
Remove parentheses
print 3 + 5 =, 3 + 5
Add quotes around text
print("3 + 5 =", 3 + 5)
Remove comma
print(3 + 5 = 3 + 5)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What needs to be added to make num1 a whole number?
num1 = input("Enter an integer")
Wrap the input inside an int() function
num1 = int(input("Enter an integer"))
Clearer text inside the input brackets
num1 = input("Enter an integer - which is a whole number, no decimals!")
6.
FILL IN THE BLANK QUESTION
45 sec • 1 pt
Turn num1 into a whole number
num1 = ____input("Enter an integer"))
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will the following code print if you type in 7?
num1 = input("Enter an integer")
print("Your number becomes: ", num1 + 10)
Your number becomes 17
Your numbers becomes: 710
TypeError: must be str, not int
Your number becomes: 17
Create a free account and access millions of resources
Similar Resources on Wayground
14 questions
Data types and Input

Quiz
•
7th - 9th Grade
14 questions
Python Data types & Exceptions

Quiz
•
1st - 10th Grade
10 questions
ôn tập tin 8 python

Quiz
•
8th Grade
15 questions
8.1 Microbits Plenary

Quiz
•
8th Grade
10 questions
Python L2 Input & Variable

Quiz
•
6th - 8th Grade
13 questions
Program Development - Python: Errors

Quiz
•
8th - 10th Grade
7 questions
Pythonkod

Quiz
•
6th - 8th Grade
10 questions
Intro to Python

Quiz
•
KG - University
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
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
8 questions
Time Management

Quiz
•
6th Grade
15 questions
Acceptable Use Policy (Quiz)

Quiz
•
6th - 8th Grade
25 questions
Career Vs. Job

Quiz
•
6th - 8th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
20 questions
Copyright and Fair Use

Quiz
•
6th - 8th Grade
15 questions
Computer Components Video

Interactive video
•
8th Grade