
Introduction to Python Programming
Authored by Andrew Powell
Computers
9th Grade
Used 14+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following Python code do? if user == "Elizabeth": print("Good morning Your Majesty") else: print("Hello", user)
Checks if the user is Elizabeth and prints a personalized greeting.
Prints "Hello" followed by the user's name for all inputs.
Compares if two variables are equal.
Always prints "Good morning Your Majesty."
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which operator checks if two values are not equal in Python?
==
!=
<
>=
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output if the input is 13? lucky = 13 print("Guess my number:") guess = int(input()) if guess == lucky: print("Amazing, you guessed it") else: print("Sorry, it's not", guess)
"Amazing, you guessed it"
"Sorry, it's not 13"
"My lucky number is 13"
No output
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of importing the randint function from the random module?
To allow the program to compare two numbers.
To generate random integers within a specified range.
To check if a condition is true or false.
To handle user input more effectively.
5.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
Fill in the blank to complete the code for rolling a dice: from random import randint diceroll = _______ print("You rolled a", diceroll)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output if diceroll equals 4? from random import randint diceroll = 4 if diceroll > 3: print(diceroll, "is a large roll") else: print(diceroll, "is a small roll")
"4 is a large roll"
"4 is a small roll"
No output
"Yet you rolled a 4"
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
True or False: The output of the following code will always be the same. from random import randint diceroll = randint(1,6) print("You rolled a", diceroll)
True
False
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
8 questions
Basic computer
Quiz
•
9th - 12th Grade
11 questions
Computers
Quiz
•
4th - 10th Grade
13 questions
Programming Concepts Quiz
Quiz
•
6th Grade - University
10 questions
Programming with C++
Quiz
•
9th - 12th Grade
10 questions
Visual Basic 2010
Quiz
•
8th Grade - University
10 questions
Списки Python + Pygame
Quiz
•
KG - University
10 questions
Women in Tech by Sisters of Code
Quiz
•
9th - 12th Grade
10 questions
แบบทดสอบเรื่องระบบคอมพิวเตอร์และการสื่อสาร
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade