Python

Python

University

10 Qs

quiz-placeholder

Similar activities

ITMC232-ZT31Am PRE-TEST

ITMC232-ZT31Am PRE-TEST

University

10 Qs

Robótica semana 12

Robótica semana 12

University

8 Qs

IOT TVET

IOT TVET

University

10 Qs

Devops 1 Quiz

Devops 1 Quiz

University

7 Qs

The Refrigeration Cycle

The Refrigeration Cycle

University

10 Qs

Cuestionario sobre Programación en Python

Cuestionario sobre Programación en Python

University

10 Qs

Quiz tentang Dataset dan AI/ML

Quiz tentang Dataset dan AI/ML

University

10 Qs

Midterm Quiz in Open-Source Programming

Midterm Quiz in Open-Source Programming

University

10 Qs

Python

Python

Assessment

Quiz

Instructional Technology

University

Medium

Created by

Kelvin Kipchumba

Used 1+ times

FREE Resource

10 questions

Show all answers

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

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?