Python Programming Quiz

Python Programming Quiz

11th Grade

15 Qs

quiz-placeholder

Similar activities

AIJ XI TKJ

AIJ XI TKJ

11th Grade

10 Qs

Operating system

Operating system

11th - 12th Grade

10 Qs

Excel - Funciones de Estadística

Excel - Funciones de Estadística

10th - 12th Grade

20 Qs

EmTech Q1 Post Test 3

EmTech Q1 Post Test 3

11th Grade

10 Qs

Latihan Ujian TKJ - Bagian A1

Latihan Ujian TKJ - Bagian A1

7th Grade - University

10 Qs

Python with DataScience

Python with DataScience

7th Grade - University

10 Qs

Security and Ethics

Security and Ethics

9th - 12th Grade

17 Qs

Design your website

Design your website

7th - 12th Grade

20 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

11th Grade

Practice Problem

Hard

Created by

Freddie-Ray Morrison

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What data type would you use to store a person's age in Python?

`float`

`string`

`int`

`boolean`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to open a file for reading in Python?

`open("myfile.txt", "r")`

`file.open("myfile.txt", "read")`

`open.file("myfile.txt", "r")`

`file("myfile.txt", "read")`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet? ```python print(type(3.14)) ```

`int`

`float`

`string`

`number`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you correctly handle an exception in Python?

```python try: # code to try except ErrorName: # code to run in case of an error ```

```python try: # code to try catch ErrorName: # code to run in case of an error ```

```python try: # code to try error ErrorName: # code to run in case of an error ```

```python try: # code to try failure ErrorName: # code to run in case of an error ```

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a mutable data type in Python?

`tuple`

`string`

`list`

`int`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you read a file line by line in Python?

```python with open("myfile.txt") as file: for line in file.readlines(): print(line) ```

```python with open("myfile.txt") as file: while line = file.readline(): print(line) ```

```python with open("myfile.txt", "r") as file: for line in file: print(line) ```

All of the above

7.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Whos the best football team?

PUFC

POSH

Peterborough United

Not cambridge

Access all questions and much more by creating a free account

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

Already have an account?