N5 - Python Recap

N5 - Python Recap

11th Grade

28 Qs

quiz-placeholder

Similar activities

8th Grade (Programming B)

8th Grade (Programming B)

8th - 12th Grade

25 Qs

[AP CSP] Programming Lesson 1 - Input/Output, Data Types

[AP CSP] Programming Lesson 1 - Input/Output, Data Types

9th - 12th Grade

25 Qs

CPM2 Quiz Review

CPM2 Quiz Review

10th - 12th Grade

25 Qs

Python Basics-01

Python Basics-01

9th - 12th Grade

32 Qs

Python L1 Programming Challenge

Python L1 Programming Challenge

1st - 12th Grade

30 Qs

Basic Python

Basic Python

6th - 12th Grade

30 Qs

Python 2d topic (типы данных, ввод, вывод)

Python 2d topic (типы данных, ввод, вывод)

6th - 12th Grade

27 Qs

Python for Absolute Beginners

Python for Absolute Beginners

8th - 12th Grade

25 Qs

N5 - Python Recap

N5 - Python Recap

Assessment

Quiz

Computers

11th Grade

Hard

Created by

S Johnston

Used 3+ times

FREE Resource

28 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does input("Enter your name: ") do?

Displays your name

Prints a message

Asks the user for input

Creates a variable

Answer explanation

The function input("Enter your name: ") prompts the user to enter their name, effectively asking for input. It does not display or print anything by itself, nor does it create a variable directly.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which line outputs a message to the screen?

input("Message")

print("Message")

message = "Message"

display("Message")

Answer explanation

The correct choice is 'print("Message")' because it is the function used in Python to output messages to the screen. The other options do not display messages: 'input' takes input, assignment does not output, and 'display' is not a standard function.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of: print("Hello" + "World")

Hello + World

Hello World

HelloWorld

Error

Answer explanation

The expression 'Hello' + 'World' concatenates the two strings without any space, resulting in 'HelloWorld'. Therefore, the correct output is 'HelloWorld'.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is wrong with this line? print("Your age is " + age)

Nothing

It needs int(age)

It needs str(age)

The + is incorrect

Answer explanation

The line is incorrect because 'age' is likely an integer. To concatenate it with a string, it needs to be converted to a string using str(age). Thus, the correct choice is 'It needs str(age)'. This allows proper string concatenation.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which input line saves the response in a variable?

print("Enter your name")

input("Enter your name")

name = input("Enter your name: ")

response = print("Enter name: ")

Answer explanation

The correct choice is 'name = input("Enter your name: ")' because it assigns the user's input to the variable 'name'. The other options either do not save the input or use incorrect syntax.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which line assigns the value 12 to a variable?

12 = age

age == 12

age = 12

assign age 12

Answer explanation

The correct line is 'age = 12', which uses the assignment operator '=' to assign the value 12 to the variable 'age'. The other options either use incorrect syntax or do not perform an assignment.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is a string?

"17"

17

True

17.0

Answer explanation

The correct choice is "17" because it is enclosed in quotes, making it a string. The other options are either numbers or a boolean, which are not strings.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?