Revision and Extended Learning for  Lab 1

Revision and Extended Learning for Lab 1

University

26 Qs

quiz-placeholder

Similar activities

Python Programming Basics 1

Python Programming Basics 1

University

25 Qs

Beginning C Programming

Beginning C Programming

University

23 Qs

python_quiz

python_quiz

University

25 Qs

python collection

python collection

University

29 Qs

Introduction to Python

Introduction to Python

KG - University

25 Qs

CS0012 Spring 25 Midterm Review

CS0012 Spring 25 Midterm Review

University

22 Qs

TECH_IQ_HUNT ROUND

TECH_IQ_HUNT ROUND

University

25 Qs

Assignment 2(CIVIL)

Assignment 2(CIVIL)

University

25 Qs

Revision and Extended Learning for  Lab 1

Revision and Extended Learning for Lab 1

Assessment

Quiz

Computers

University

Medium

Created by

Careene McCallum

Used 2+ times

FREE Resource

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What TYPE of value is stored in the variable num?

Integer

Float

String

Boolean

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What will be the value of ans if num is 12?

4.0

4

4.33

TypeError: unsupported operand type(s) for /: 'str' and 'int'

3.

MULTIPLE SELECT QUESTION

1 min • 1 pt

Media Image

What correction should be made to line 2 to ensure proper execution? NB: There are TWO possible answers.

ans = float(num) /3

ans = num(float) / 3

ans = f"{float(num) / 3}"

ans = f"(float(num) / 3)"

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What value is printed if the user enters 12?

TypeError: unsupported operand type(s) for /: 'str' and 'int'

4.33

4

4.0

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the data type of formatted_num?

str

int

float

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the data type for formatted_num?

str

int

float

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the purpose of :d in the f-string?

It ensures that the variable num_items is treated as an integer when formatting the output.

It formats the number as a string.

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?