Search Header Logo

COMP1010 Week 7 Quiz

Authored by Ethan Ryoo

Computers

University

Used 3+ times

COMP1010 Week 7 Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which number(s) will this code print?

0 only

1 only

0, 1, 2

1, 2, 3

2.

FILL IN THE BLANKS QUESTION

30 sec • 1 pt

Media Image

A user enters the numbers 5 and -2. What does line 3 print?

(a)  

3.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Media Image

Which line(s) in this code correctly print(s) five asterisks in a row (*****)? Multiple options may be correct.

Line 1

Line 2

Line 3

Line 4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the value of x on line 5?

4

5

None

The code breaks since there is no else clause

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Which statement is true regarding line 6?

It behaves similarly to my_func(1)

It enters an infinite loop

It prints nothing because my_func returns None

It prints -1

6.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

Refer to Image A. There is one error in the function mth_to_season. On which line is it located?

(a)  

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Refer to Image B. Which of these data structures is useful for converting months into seasons?

X only

Y only

Both can be useful

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?