Which of the following is used to create a single-line comment in Python?

python basic

Quiz
•
Computers
•
Professional Development
•
Medium
KEERTHI BADUGU
Used 3+ times
FREE Resource
21 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
a) // This is a comment
b) # This is a comment
c) /* This is a comment */
d) <!-- This is a comment -->
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid variable name in Python?
a) 1variable
b) variable1
c) variable-1
d) variable 1
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a mutable data type in Python?
a) tuple
b) list
c) str
d) int
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax for an if statement in Python?
a) if x == 10 then:
b) if (x == 10):
c) if x == 10:
d) if x = 10:
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create an infinite loop in Python?
a) while (true):
b) while True:
c) for(;;):
d) while (1):
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you define a function in Python?
a) function my_function():
b) def my_function():
c) define my_function():
d) func my_function():
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to open a file for reading in Python?
a) open('filename', 'r')
b) open('filename', 'w')
c) open('filename', 'rw')
d) open('filename', 'read')
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
mots de passe

Quiz
•
Professional Development
25 questions
LIST-TUPLES-SET-DICTIONARY

Quiz
•
Professional Development
20 questions
Round-1 Technical Aptitude

Quiz
•
11th Grade - Professi...
20 questions
C Code Master

Quiz
•
Professional Development
20 questions
Season 5 #Spaic Python Weekly Quiz

Quiz
•
KG - Professional Dev...
20 questions
Linux Talan Inside Quiz

Quiz
•
University - Professi...
20 questions
Fundamentals I. Principio de módulo

Quiz
•
Professional Development
20 questions
DBMS-QUIZ

Quiz
•
Professional Development
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade