Search Header Logo

Python

Authored by Kelvin Kipchumba

Instructional Technology

University

10 Questions

Used 1+ times

Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the purpose of a function in programming?

To group related code so it runs automatically

To perform a specific task and can be reused

To automatically execute when a script starts

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How do you define a function in Python?

function myFunc():

define myFunc():

def myFunc():

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What does indentation do in Python?

Makes the code more readable but has no effect

Groups code blocks and affects execution

Separates different files in a program

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What happens if you forget to indent code inside a function in Python?

It gives an indentation error

It converts the code to a comment

It skips the code silently

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is a variable in programming?

A special keyword that starts loops

A container for storing data values

A fixed location in memory

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of these is a valid way to assign a variable in Python?

10 = var

int var = 10

variable: 10

var = 10

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the data type of: "42.5"

Float

String

Integer

Boolean

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?