Python Coding Contest - Level 1

Python Coding Contest - Level 1

University

25 Qs

quiz-placeholder

Similar activities

DWDM-2

DWDM-2

University

20 Qs

Relational Algebra and Calculus

Relational Algebra and Calculus

University

20 Qs

Micro Arch - CPUs & Fetch-Execute

Micro Arch - CPUs & Fetch-Execute

University

20 Qs

2TK - Review Dinamik Routing - 091219

2TK - Review Dinamik Routing - 091219

University

20 Qs

Cloud Review Quiz

Cloud Review Quiz

University

20 Qs

AI BootCamp: 2024 Edition- Session 1

AI BootCamp: 2024 Edition- Session 1

University

20 Qs

Pra UPS 2

Pra UPS 2

University

20 Qs

STM 2013 : FORMATIF T3-FORM & REPORT

STM 2013 : FORMATIF T3-FORM & REPORT

University

20 Qs

Python Coding Contest - Level 1

Python Coding Contest - Level 1

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Arunkumar Saravanan

Used 9+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?