Python Fundamentals

Python Fundamentals

12th Grade

15 Qs

quiz-placeholder

Similar activities

Python Basics

Python Basics

12th Grade

20 Qs

PI Mod 1 quiz

PI Mod 1 quiz

9th - 12th Grade

10 Qs

PCEP Section 2B: Perform different types of iterations

PCEP Section 2B: Perform different types of iterations

12th Grade

15 Qs

2^ Quiz 3I

2^ Quiz 3I

12th Grade

20 Qs

Python In transit loops and iterations

Python In transit loops and iterations

12th Grade

20 Qs

Python функциялары  7 сынып

Python функциялары 7 сынып

12th Grade - University

15 Qs

คำสั่งพื้นฐานในภาษา Python (เก็บคะแนนครั้งที่ 2)

คำสั่งพื้นฐานในภาษา Python (เก็บคะแนนครั้งที่ 2)

12th Grade

20 Qs

Lists in Python

Lists in Python

11th - 12th Grade

20 Qs

Python Fundamentals

Python Fundamentals

Assessment

Quiz

Computers

12th Grade

Hard

Created by

DIVYA DIVYA

Used 2+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between a variable and a constant in Python?

A variable can only store integers, while a constant can store any data type in Python.

A variable is a data type, while a constant is a function in Python.

A variable is defined using 'const', while a constant is defined using 'var' in Python.

A variable can be reassigned, while a constant's value cannot be changed in Python.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a variable in Python?

declare variable_name

variable = value

value = variable_name

variable_name = value

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the basic data types in Python?

array

char

float

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

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for an if statement in Python?

if (condition):

if condition:

if condition {

if condition then:

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write an if-else statement in Python?

else:

if condition:

if condition: # code block to execute if condition is true else: # code block to execute if condition is false

if condition:

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a for loop in Python?

To perform mathematical calculations

To iterate over a sequence and execute a block of code for each item in the sequence.

To create classes and objects

To handle user input

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you iterate over a list in Python?

while item in my_list:

for i in range(len(my_list)):

foreach item in my_list:

for item in my_list:

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?