Search Header Logo

Python- Variables

Authored by Aram M

Computers

3rd Grade

Used 2+ times

Python- Variables
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a variable in Python?

A type of function in Python

A special character used in Python coding

A type of snake in the Amazon rainforest

A reserved memory location to store values

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a variable in Python?

variable = value_name

value = variable_name

variable_name = value

name = variable_value

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the rules for naming a variable in Python?

Variables cannot contain numbers

Variables can start with any special character

Variables must start with a letter or underscore, followed by letters, digits, or underscores. They are case-sensitive and cannot be a keyword.

Variables are not case-sensitive

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between local and global variables in Python?

Local variables are defined within a function and can only be accessed within that function, while global variables are defined outside of any function and can be accessed throughout the entire program.

Local variables are defined within a function and can be accessed throughout the entire program, while global variables are defined within a function and can only be accessed within that function

Local variables can be accessed throughout the entire program, while global variables are defined within a function

Local variables are defined outside of any function and can be accessed throughout the entire program, while global variables are defined within a function

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Give an example of a variable assignment in Python.

x = 5

z = True

y = 3.14

x = 'hello'

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the different data types in Python?

red, blue, green, yellow, purple

integer, float, string, list, tuple, dictionary, boolean

apple, banana, orange, grape, watermelon

dog, cat, bird, fish, rabbit

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between int and float data types in Python?

int represents letters and float represents special characters

int represents even numbers and float represents odd numbers

int represents whole numbers and float represents numbers with decimal points

int represents negative numbers and float represents positive numbers

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?