N5 - Python Recap

N5 - Python Recap

11th Grade

•

28 Qs

quiz-placeholder

Similar activities

Computer Parts

Computer Parts

9th - 12th Grade

•

29 Qs

Enkripsi Data kl 8 smt 1

Enkripsi Data kl 8 smt 1

11th Grade

•

25 Qs

Brynleigh

Brynleigh

2nd Grade - University

•

23 Qs

Macromedia Flash

Macromedia Flash

8th Grade - Professional Development

•

26 Qs

UTS TLJ XI Semester Genap 22/23

UTS TLJ XI Semester Genap 22/23

11th Grade

•

25 Qs

Quiz 1

Quiz 1

11th - 12th Grade

•

25 Qs

UH-3 DASAR DESAIN GRAFIS

UH-3 DASAR DESAIN GRAFIS

1st Grade - University

•

25 Qs

Ôn tập Tin 10

Ôn tập Tin 10

9th - 12th Grade

•

24 Qs

N5 - Python Recap

N5 - Python Recap

Assessment

Quiz

•

Computers

•

11th Grade

•

Practice Problem

•

Hard

Created by

S Johnston

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?