
Python Coding Contest - Level 1

Quiz
•
Computers
•
University
•
Hard
Arunkumar Saravanan
Used 9+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
x = 1
while True:
if x % 5 = = 0:
break
print(x)
x + = 1
What will be the output of this code?
error
2 1
0 3 1
None of these
Answer explanation
Syntax error, there should not be a space between + and =.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which one of the following syntaxes is the correct syntax to read from a simple text file stored in ''d:\java.txt''?
Infile = open(''d:\\java.txt'', ''r'')
Infile = open(file=''d:\\\java.txt'', ''r'')
Infile = open(''d:\java.txt'',''r'')
Infile = open.file(''d:\\java.txt'',''r'')
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
x = ['XX', 'YY']
for i in a:
i.lower()
print(a)
['xx', 'yy']
['XX', 'YY']
[XX, yy]
None of these
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
import math
abs(math.sqrt(36))
Error
-6
6
6.0
Answer explanation
This function prints the square of the value.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Study the following function:
any([5>8, 6>3, 3>1])
What will be the output of this code?
False
True
Invaid Code
None of these
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Study the following statement:
>>>"a"+"bc"
What will be the output of this statement?
a+bc
abc
a bc
a
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Study the following code:
>>>"javatpoint"[5:]
javatpoint
java
point
none of these
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Compiler Design

Quiz
•
University
20 questions
Python Recap

Quiz
•
7th Grade - University
23 questions
Beginning C Programming

Quiz
•
University
20 questions
Python Strings

Quiz
•
University
20 questions
Python :: String review

Quiz
•
University
25 questions
PYTHON CONTEST

Quiz
•
University
21 questions
QUIZ PEMROGRAMAN DASAR

Quiz
•
12th Grade - University
25 questions
PYTHON CONTEST 2

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