Python- Variables

Python- Variables

3rd Grade

10 Qs

quiz-placeholder

Similar activities

Python 101

Python 101

1st - 5th Grade

15 Qs

Computer Science

Computer Science

3rd - 12th Grade

12 Qs

Python - 01

Python - 01

1st - 5th Grade

11 Qs

4.2 STRUKTUR KOD ARAHAN

4.2 STRUKTUR KOD ARAHAN

3rd Grade

15 Qs

Python L1 Quiz 8: Designing Programs

Python L1 Quiz 8: Designing Programs

1st - 12th Grade

10 Qs

Coding Basics

Coding Basics

3rd - 4th Grade

15 Qs

Python Classes

Python Classes

3rd Grade

9 Qs

for---Loop

for---Loop

3rd Grade - University

13 Qs

Python- Variables

Python- Variables

Assessment

Quiz

Computers

3rd Grade

Hard

Created by

Aram M

Used 1+ 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 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

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?