Python Programming Quiz

Python Programming Quiz

11th Grade

15 Qs

quiz-placeholder

Similar activities

Paper 2 Revision - IGCSE Computer Science

Paper 2 Revision - IGCSE Computer Science

9th - 12th Grade

12 Qs

File Writing

File Writing

9th - 12th Grade

20 Qs

Chapter 1 Python

Chapter 1 Python

8th Grade - University

12 Qs

String Manipulation (Python)

String Manipulation (Python)

9th - 12th Grade

17 Qs

Python Final Assessment

Python Final Assessment

4th - 12th Grade

10 Qs

T-Level DPDD: File Handling Quiz

T-Level DPDD: File Handling Quiz

11th Grade

14 Qs

python modules

python modules

11th Grade

20 Qs

Translators and Computing Languages: GCSE 9-1

Translators and Computing Languages: GCSE 9-1

9th Grade - University

20 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

11th Grade

Hard

Created by

Freddie-Ray Morrison

Used 1+ times

FREE Resource

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

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?