Python MCQ

Quiz
•
Computers
•
University
•
Medium
SAKTHI GOVINDARAJU
Used 52+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a correct syntax to output "Hello World" in Python?
print("Hello World")
p("Hello World")
echo "Hello World"
echo("Hello World");
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you insert COMMENTS in Python code?
#This is a comment
//This is a comment
/*This is a comment*/
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which one is NOT a legal variable name?
my-var
my_var
Myvar
_myvar
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create a variable with the numeric value 5?
x = int(5)
x = 5
Both the other answers are correct
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct file extension for Python files?
.py
.pt
.pyt
.pyth
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create a variable with the floating number 2.8?
x = 2.8
x = float(2.8)
Both the other answers are correct
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax to output the type of a variable or object in Python?
print(typeof(x))
print(typeOf(x))
print(type(x))
print(typeof x)
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
HCI 584 Python quiz

Quiz
•
University
25 questions
Introduction to Python

Quiz
•
KG - University
20 questions
PYTHON FUNCTION

Quiz
•
University
15 questions
Python introduction

Quiz
•
University
22 questions
Tin học - Bài 25

Quiz
•
10th Grade - University
15 questions
Python

Quiz
•
University
20 questions
Final_QUIZ

Quiz
•
University
15 questions
Python Fundamentals

Quiz
•
University
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade