Search Header Logo

Mashdemy 6-10 AI/ML

Authored by Mashdemy Tutor

Computers

9th - 12th Grade

Used 10+ times

Mashdemy 6-10 AI/ML
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following correctly defines a for loop in Python?

⁠⁠ for i to 10: ⁠

 for i in range(10): ⁠

for (i = 0; i < 10; i++): ⁠

 for i = 1 to 10: ⁠

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

⁠ python

for i in range(3):

print(i)

1 2 3

0 1 2 3

0 1 2

1 2 3 4

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement correctly defines a while loop?

 while i in range(10): ⁠

while (i = 10): ⁠

while i < 10: ⁠

while (i < 10) { ⁠

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop control statement is used to skip the rest of the code inside a loop for the current iteration only?

break

continue

pass

exit

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Creating Functions Using The def Keyword

How do you define a function in Python?

⁠⁠ function my_function(): ⁠

def my_function(): ⁠

create my_function(): ⁠

func my_function(): ⁠

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which library do you need to import to use NumPy arrays?

import numpy

import pandas

import array

import math

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

number = 4

if number % 2 == 0:

print("The number is even.")

else:

print("The number is odd.")

The number is odd.

The number is even.

error

nothing

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?