Search Header Logo

GDScript Quiz - Lesson 3 - Conditional statements & Iteration

Authored by Peter Fletcher

Computers

12th Grade

Used 3+ times

GDScript Quiz - Lesson 3 - Conditional statements & Iteration
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

45 sec • 1 pt

Which of the following is the correct syntax for an if-else statement in GDScript?

Media Image
Media Image
Media Image
Media Image

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following code snippets will print "Success" if the variable score is 80?

if score == 80: print("Success")

if score >= 80: print("Success")

if score > 80: print("Success")

if score = 80: print("Success")

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will the following code snippet output to the console?
var count = 3

while count > 0:

print(count)

count -= 1

1

2

3

3

2

1

3

2

1

0

0

1

2

3

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which loop structure in GDScript allows you to iterate over a specific range of numbers?

while-loop

for-loop

loop-until

do-while-loop

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Identify the correct syntax to create a for-loop that iterates over the numbers 0 to 4 in GDScript.

for i in range(0, 5):

print(i)

for i from 0 to 5:

print(i)

for i from 0, 5:

print(i)

for i from 0 to 4:

print(i)

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

Consider the following code snippet:

What will be the output?

2

4

1

3

5

1

2

3

4

5

2

3

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

Given the following code snippet, what is the output to the console?

Less than 5

Greater or equal to 5

Not Output

Error in Code

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?