Search Header Logo

Python Basics

Authored by Mehdi SLAOUI

Computers

University

Used 3+ times

Python Basics
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

What is a correct syntax to output "Hello World" in Python?

print(Hello World)
Print("Hello World")
print("Hello World")
print "Hello World"

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How do you insert COMMENTS in Python code?

#This is a comment
/*This is a comment*/
//This is a comment
"This is a comment"

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the correct file extension for Python files?

.pt
.py
.pyt
.python

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the correct way to create a function in Python?

create my_function():
func my_function():
void my_function():
def my_function():

5.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which operator can be used to compare two values?

=<
<>
==
<=

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of these collections defines a LIST?

{"apple", "banana", "cherry"}
("apple", "banana", "cherry")
["apple", "banana", "cherry"]
{"name": "apple", "color": "green"}

7.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

How do you start writing a for loop in Python?

for x in [1,2,3]:

for each x in [1,2,3]:

for (x=0, x<10, x++):

for i in range(0, 10):

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?

Discover more resources for Computers