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
10 questions
Python-Code Right or Wrong

Quiz
•
7th - 8th Grade
16 questions
Variables

Quiz
•
7th - 10th Grade
8 questions
Python Functions Test

Quiz
•
6th Grade
12 questions
алгоритм python

Quiz
•
6th - 8th Grade
12 questions
Computer Systems - How the web works - Lesson 7

Quiz
•
8th Grade
10 questions
Типы данных

Quiz
•
7th Grade
15 questions
Python

Quiz
•
6th Grade - University
12 questions
Python

Quiz
•
7th - 8th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
30 questions
Teacher Facts

Quiz
•
6th Grade
24 questions
Flinn Lab Safety Quiz

Quiz
•
5th - 8th Grade
22 questions
Figurative Language

Quiz
•
7th Grade