Python Basics

Python Basics

University

10 Qs

quiz-placeholder

Similar activities

Chapter 1: Python Overview

Chapter 1: Python Overview

University

10 Qs

CodeTigers Python 101

CodeTigers Python 101

KG - Professional Development

10 Qs

Quiz 142 - Python inputs and outputs

Quiz 142 - Python inputs and outputs

9th Grade - University

15 Qs

Python Conditionals and If Statements

Python Conditionals and If Statements

8th Grade - University

15 Qs

Engineering: EE/CE/CS

Engineering: EE/CE/CS

University

15 Qs

Python Quiz

Python Quiz

University

9 Qs

PROGRAMMING IN PYTHON - UNIT II - TEST 1 MCQS

PROGRAMMING IN PYTHON - UNIT II - TEST 1 MCQS

University

15 Qs

python String and comment

python String and comment

3rd Grade - University

13 Qs

Python Basics

Python Basics

Assessment

Quiz

Computers

University

Medium

Created by

Mehdi SLAOUI

Used 3+ times

FREE Resource

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):

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?