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
15 questions
Python basics

Quiz
•
6th - 8th Grade
10 questions
Python - kl. 8

Quiz
•
7th - 12th Grade
16 questions
Some Python basics

Quiz
•
6th - 8th Grade
15 questions
PYTHON - 57

Quiz
•
7th Grade
11 questions
Python for Class 7

Quiz
•
7th - 8th Grade
13 questions
Python

Quiz
•
7th - 8th Grade
14 questions
year 8 lesson 2 quiz - python

Quiz
•
8th - 10th Grade
10 questions
Perangkat Komputer

Quiz
•
1st - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
typing

Quiz
•
6th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
20 questions
Input, Output, Processing or Storage

Quiz
•
5th - 6th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade