Introduction to Python Programming

Introduction to Python Programming

9th Grade

8 Qs

quiz-placeholder

Similar activities

matplotlib

matplotlib

8th - 11th Grade

10 Qs

Chapter 5

Chapter 5

9th Grade

10 Qs

Двовимірні масиви в Python

Двовимірні масиви в Python

1st Grade - University

12 Qs

While Loops Test Review

While Loops Test Review

9th - 12th Grade

12 Qs

9. Python (Модули, файлы)

9. Python (Модули, файлы)

5th - 11th Grade

13 Qs

Module 2 Mini Quiziz Review

Module 2 Mini Quiziz Review

9th - 12th Grade

7 Qs

Информатика

Информатика

9th Grade

8 Qs

AR3_Starter

AR3_Starter

9th Grade

9 Qs

Introduction to Python Programming

Introduction to Python Programming

Assessment

Quiz

Computers

9th Grade

Hard

Created by

Andrew Powell

Used 14+ times

FREE Resource

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

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code when coin is 0? from random import randint coin = randint(0,1) if coin == 0: result = "heads" print(result) else: result = "tails"

"heads"

"tails"

"Either heads or nothing"

"Either heads or tails"