Python Variables Quiz

Python Variables Quiz

5th Grade

10 Qs

quiz-placeholder

Similar activities

Prueba Diagnóstica de ED. a través de tecnologías digitales

Prueba Diagnóstica de ED. a través de tecnologías digitales

1st Grade - University

10 Qs

Python Programming Quiz

Python Programming Quiz

4th - 6th Grade

7 Qs

Lesson 1: Introduction to Python

Lesson 1: Introduction to Python

5th - 12th Grade

8 Qs

Year 5 ICT Assessment

Year 5 ICT Assessment

5th Grade

15 Qs

Hamza quiz

Hamza quiz

5th Grade

10 Qs

Python Basics

Python Basics

KG - University

15 Qs

Scope of Variables in Python

Scope of Variables in Python

1st Grade - Professional Development

15 Qs

python String and comment

python String and comment

3rd Grade - University

13 Qs

Python Variables Quiz

Python Variables Quiz

Assessment

Quiz

Computers

5th Grade

Easy

Created by

Shushankita Vinod Mishra

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a variable in Python?

A type of loop

A container that holds data

A special function in Python

A built-in keyword

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid variable name?

1name

my-score

_age

my score

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? Age = 30 age = 25 print(Age, age)

30 25

25 30

Error: Variables cannot have different cases

None of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid rule for naming variables in Python?

Variable names must start with a letter or an underscore

Variable names can contain spaces

Variable names are case-sensitive

Variable names should not use Python keywords

5.

OPEN ENDED QUESTION

3 mins • 1 pt

What will be the output of the following code? name = "Alice" age = 18 print(type(name)) print(type(age))

Evaluate responses using AI:

OFF

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is the following variable declaration invalid? def = "Hello"

Variable names cannot contain strings

def is a Python keyword

def must start with an underscore

Python does not allow assigning strings to variables

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a meaningful variable name?

x

var1

student_score

abc

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?