PCEP Practice 1

PCEP Practice 1

9th Grade

24 Qs

quiz-placeholder

Similar activities

Strings, Lists & Tuples

Strings, Lists & Tuples

9th - 12th Grade

20 Qs

Python basics

Python basics

2nd - 9th Grade

20 Qs

Bài kiểm tra giữa kì 2

Bài kiểm tra giữa kì 2

9th - 12th Grade

20 Qs

Python Recap

Python Recap

7th Grade - University

20 Qs

Programming Techniques Survey

Programming Techniques Survey

8th - 12th Grade

19 Qs

Python Review Quiz

Python Review Quiz

7th - 9th Grade

20 Qs

Token in Python

Token in Python

9th Grade

20 Qs

Python 1

Python 1

7th - 9th Grade

20 Qs

PCEP Practice 1

PCEP Practice 1

Assessment

Quiz

Computers

9th Grade

Medium

Created by

John Chapman

Used 6+ times

FREE Resource

24 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to declare a variable in Python?

`int x = 10`

`x = 10`

`declare x = 10`

`var x = 10`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

`tuple`

`list`

`str`

`int`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code snippet? ```python x = 5 y = 10 print(x + y) ```

`15`

`510`

`5 + 10`

`Error`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct `if` statement in Python?

`if x = 5:`

`if (x == 5)`

`if x == 5:`

`if x = 5 then`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? ```python for i in range(3): print(i) ```

`0 1 2`

`1 2 3`

`0 1 2 3`

`3 2 1`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to define a function in Python?

`func`

`define`

`def`

`function`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```python def add(a, b): return a + b print(add(2, 3)) ```

`5`

`23`

`2 + 3`

`Error`

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?