Python Fundamentals

Python Fundamentals

12th Grade

15 Qs

quiz-placeholder

Similar activities

Bài 6_Lớp 11_Tại lớp

Bài 6_Lớp 11_Tại lớp

12th Grade

10 Qs

Internet seguro

Internet seguro

8th Grade - University

10 Qs

Quiz Pemrograman Perangkat Bergerak 2

Quiz Pemrograman Perangkat Bergerak 2

12th Grade - University

20 Qs

Baze de date-Design

Baze de date-Design

12th Grade

10 Qs

BTEC Level 3 Nat Ext Dip in Computing - Unit 2.1 Hardware and Software

BTEC Level 3 Nat Ext Dip in Computing - Unit 2.1 Hardware and Software

11th - 12th Grade

10 Qs

สอบเก็บคะแนน ไพทอน ม.4

สอบเก็บคะแนน ไพทอน ม.4

9th - 12th Grade

10 Qs

Python Fundamentals

Python Fundamentals

Assessment

Quiz

Computers

12th Grade

Practice Problem

Hard

Created by

DIVYA DIVYA

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

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:

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?