Python_Quiz_1

Python_Quiz_1

Professional Development

12 Qs

quiz-placeholder

Similar activities

X-Quiz #4

X-Quiz #4

Professional Development

10 Qs

DevNet Express

DevNet Express

10th Grade - Professional Development

11 Qs

PE2 Module 3

PE2 Module 3

KG - Professional Development

11 Qs

Python

Python

University - Professional Development

10 Qs

python quiz

python quiz

6th Grade - Professional Development

10 Qs

Introduction

Introduction

Professional Development

10 Qs

Basic Python

Basic Python

Professional Development

10 Qs

Python Data Types

Python Data Types

Professional Development

10 Qs

Python_Quiz_1

Python_Quiz_1

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Marvin Chua

Used 2+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the extension of a Python file?

.pyc

.py

.python

.pf

2.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

What is the correct syntax to output "Bye, World" in Python?

echo("Bye, World")

print("Bye, World")

printf("Bye, World")

print('Bye', 'World', sep=', ')

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Is Python compiled or interpreted?

Compiled

Interpreted

Both

Answer explanation

When you first run a Python script, it is converted to bytecode. This process is called compilation.

Python then executes the bytecode. This process is called interpretation.

Thus, Python is a hybrid language.

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following functions can convert a string to a float in Python?

str()

int()

float()

bool()

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the output of the following code?

print(type(10))

<class 'int'>

type(10)

<class 'str'>

"10"

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is used to define a function in Python?

func

function

def

define

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the output of the following code?

scores = [97, 98, 99, 100]

print(scores[0:3])

[97, 98]

[97, 98, 99]

[97, 98, 99, 100]

scores[0:3]

Answer explanation

When you use index slicing, such as scores[0:3]

you are getting the elements from index 0 to index 2.

In other words, from 0 (inclusive) to 3 (exclusive)

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?