Search Header Logo

Python Programming Fundamentals

Authored by Omnia Abdelghany

Computers

Used 17+ times

Python Programming Fundamentals
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the different data types in Python?

The different data types in Python are: int, float, complex, str, list, tuple, set, dict, bool, and NoneType.

integer, decimal, character, list, boolean

number, text, array, dictionary, boolean

int, float, string, array, boolean

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for an if statement in Python?

The syntax for an if statement in Python is: if {condition}

The syntax for an if statement in Python is: if condition: # code block

The syntax for an if statement in Python is: if condition then

The syntax for an if statement in Python is: if (condition)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you write a for loop in Python?

for i in range(1, 10, 2):

for x in range(5, 10):

for item in iterable_object:

for i in range(10):

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a function in Python?

The purpose of a function in Python is to encapsulate a set of instructions that can be reused and called multiple times within a program.

The purpose of a function in Python is to print a specific value to the console

The purpose of a function in Python is to stop the execution of the program

The purpose of a function in Python is to create a new variable

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a list in Python?

A list in Python is a type of loop

A list in Python is a type of function

A list in Python is a collection of items that are ordered and changeable. It allows duplicate elements and can contain different data types.

A list in Python is a type of snake

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a tuple in Python?

A tuple in Python is a collection of unordered and mutable elements, represented by square brackets.

A tuple in Python is a data type used for storing multiple values like a list, represented by curly braces.

A tuple in Python is a collection of ordered and immutable elements, represented by parentheses.

A tuple in Python is a single value that cannot be changed, represented by angle brackets.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the concept of a dictionary in Python.

A dictionary in Python is a collection of key-value pairs. It is unordered, changeable, and does not allow duplicate keys. Each key is unique and is used to access its corresponding value.

A dictionary in Python is a collection of key-value pairs, but the keys can be duplicated.

A dictionary in Python is a collection of values without keys.

A dictionary in Python is a collection of ordered pairs.

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?