Puthon upto and including loops quiz
Quiz
•
Computers
•
9th - 12th Grade
•
Easy
Jonathan Clark
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the output be from the following code?
print("Hello world!\nHello world!")
Hello world! Hello world!
Hello world!
Hello world!
SyntaxError
Hello world!
Answer explanation
The code prints 'Hello world!' followed by a newline and then 'Hello world!' again. The correct output format includes the newline, represented as
in HTML, making the correct answer 'Hello world!
Hello world!'.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the output be from the following code?
print("Hello" + str(2) + "world!")
Hello world! Hello world!
Hello2world!
Hello Hello world! world!
SyntaxError
Answer explanation
The code concatenates the string 'Hello', the string representation of the number 2, and 'world!'. This results in 'Hello2world!', making 'Hello2world!' the correct output.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is syntax?
Syntax is the word used to describe an error
Syntax is the rules of the programming language
It is used to read information
It is used to output information
Answer explanation
Syntax refers to the set of rules that define the structure of statements in a programming language. It dictates how code must be written for the compiler or interpreter to understand it, making 'Syntax is the rules of the programming language' the correct choice.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Code executed based on a condition being true
Sequence
Selection
Iteration
Variable
Answer explanation
The correct choice is 'Selection' because it refers to code that executes based on a condition being true, allowing for decision-making in programming. In contrast, 'Sequence' is for ordered execution, 'Iteration' for loops, and 'Variable' for data storage.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Code repeated / looped until a condition has been met or a set number of times.
Sequence
Selection
Iteration
Variable
Answer explanation
Iteration refers to the process of repeating a block of code until a specific condition is met or a predetermined number of times is reached. This distinguishes it from sequence (order of execution) and selection (conditional branching).
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code do? myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
Answer explanation
The code 'myAge = int(myAge)' converts the variable myAge to an integer type. This is the correct choice, as it explicitly uses the 'int()' function to change myAge into an integer, not a string or any other type.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is python named after
The snake
Television show called Monty Python
Answer explanation
Python is named after the television show Monty Python's Flying Circus, not the snake. The creator, Guido van Rossum, chose the name for its fun and irreverent nature, reflecting the language's design philosophy.
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
16 questions
GCSE OCR Understanding Network Protocols
Quiz
•
10th Grade
20 questions
Uji Pemahaman Microsoft Word X TKJ 1
Quiz
•
12th Grade
17 questions
Day-I (Summary Quiz) for ICT Skill Share
Quiz
•
KG - Professional Dev...
18 questions
AQA GCSE 8525 Logic Gate Basics
Quiz
•
9th - 10th Grade
18 questions
SST Yr8 - NCCE - Algorithms 2
Quiz
•
9th - 12th Grade
17 questions
Security and Ethics
Quiz
•
9th - 12th Grade
15 questions
Coding Quiz
Quiz
•
6th - 10th Grade
20 questions
2.3.1 Graph Traversal & Path Finding Algorithms
Quiz
•
12th Grade - University
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd 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
30 questions
Computer Terminology Exercise #1 ( Fill Ins)
Quiz
•
9th Grade
15 questions
MLA Formatting
Quiz
•
9th Grade
20 questions
Typing Practice
Quiz
•
7th - 12th Grade
14 questions
Inputs and Outputs: Computer Science Intro
Lesson
•
5th - 9th Grade
20 questions
Google Sheets Quiz
Quiz
•
9th Grade