Select Page

PyGuru Academy

Learn Python to Build AI

AI
/15

Python Quiz 1 (Q1 ~ Q15)

1 / 15

Q. 1
Are the following statements valid in Python 3?

a, b = 0 ** 3, 0 / 3
print(a, b)

 

 

2 / 15

Q. 2
In Python, which letter is used to represent imaginary numbers?

 

3 / 15

Q. 3
In Python, 6 % 10 is 6. What's the output of this code snippet?

print (6 % -10)

 

 

4 / 15

Q. 4
In Python, a set can contain duplicate items.

5 / 15

Q. 5
What does PyPI stand for in the Python programming world?

6 / 15

Q. 6
What would be the result of evaluating the following Python code?

my_dict = {"a": 1,"b": 2}
x = my_dict.keys()
my_dict["c"] = 3
print(x)

 

7 / 15

Q. 7
Which command correctly lists all installed Python packages?

8 / 15

Q. 8
What is the output of following Python code?

print([1, 2, 3] + [4, 5, 6])

 

9 / 15

Q. 9
What's the output of this Python code?

a = True <= False
print(a)

 

10 / 15

Q. 10
Which Python code correctly calculates and prints the sum of two numbers?

a = True <= False
print(a)

 

11 / 15

Q. 11
What is the output of following Python code?

print(bool("False"))

 

12 / 15

Q. 12
What is the output of following Python code?

print(1 + True)

 

13 / 15

Q. 13
Using the datetime module, which statement correctly prints the current date and time?

import datetime

 

14 / 15

Q. 14
What is the output of following Python code?

mylist = [1, 2, 3, 4]
print(mylist[-1:-1])

 

15 / 15

Q. 15
What is the output of following Python code?

mydict = {"dob": 1998, "dob": 2002, "dob": 2005}
print(mydict["dob"])

 

Your score is

0%

/15

Python Quiz 2 (Q16 ~ Q30)

1 / 15

Q. 16
What is the output of following Python code?

print(1 ** 2 ** 2 ** 2)

 

2 / 15

Q. 17
The .pyc extension in Python stands for ....?

3 / 15

Q. 18
Is the following code valid in Python?

my_first_$ = 50

 

4 / 15

Q. 19
In the Python World, PEP stands for ....?

5 / 15

Q. 20
What is the output of following Python code? Note: In Python 3, output of print(8 // 4) is 2.

print(4 // 8)

 

6 / 15

Q. 21
What is the output of following Python code?

print('Python'.find('P'))

 

7 / 15

Q. 22
What is the output of following Python code?

print(3 / 3 ** 2)

 

8 / 15

Q. 23
What is the output of following Python code?

print("Python " + "3", "12", "0", sep=".")

 

9 / 15

Q. 24
What is the output of following Python code?

print([1, 3, 4, 2].sort())

 

10 / 15

Q. 25
How do you remove the element 'Java' from the following Python list?

my_list = ['Python', 'Ruby', 'Java', 'C++']

 

11 / 15

Q. 26
How can I add 'Player Y' to the team_2 (a python list)?

team_1 = ['Player A', 'Player B']
team_2 = ['Player X']

 

12 / 15

Q. 27
What is the output of following Python code?

print(print)

 

13 / 15

Q. 28
What is the output of following Python code?

x = 2
x += 2
print(x)

 

14 / 15

Q. 29
What is the output of following Python code?

players, points = ['A', 'B', 'C'], [10, 20, 30]
print(type(zip(players, points)))

 

15 / 15

Q. 30
In Python, we use an escape character to insert illegal characters in a string. An escape character is a ....?

Your score is

0%

/15

Python Quiz 3 (Q31 ~ Q45)

1 / 15

Q. 31
What is the output of following Python code?

print(list(range(6, 12, 2)))

 

2 / 15

Q. 32
What is the output of following Python code?

set1, set2 = {"John", 21, True}, {True, "John", 21}
print(set1 == set2)

 

3 / 15

Q. 33
What is the output of following Python code?

print(1--1)

 

4 / 15

Q. 34
What is the output of following Python code?

a = 50


def my_func():
    a = 10


my_func()
print(a)

 

 

5 / 15

Q. 35
What is the output of following Python code?

print("hello".count("a"))

 

 

6 / 15

Q. 36
What is the output of following Python code?

b = True
c = False
print(c / b)

 

 

7 / 15

Q. 37
What is the output of following Python code?

my_list = [1, 2]
print(my_list * 3)

 

 

8 / 15

Q. 38
What is the output of following Python code?

print('ai' in ['AI', 'ML', 'DS'])

 

 

9 / 15

Q. 39
Please select the correct Python code.

 

10 / 15

Q. 40
What is the correct syntax to import an entire module named "math" in Python 3?

 

11 / 15

Q. 41
What is the output of following Python code?

count += 1
print(count)

 

 

12 / 15

Q. 42
What is the output of following Python code?

list_a = [1, 2, 3]
list_b = [4, 5, 6]
print(list_b + list_a)

 

 

13 / 15

Q. 43
What is the output of following Python code?

print(len(56))

 

 

14 / 15

Q. 44
What is the output of following Python code?

z, y, x = 25, 16, 9
x, y, z = x - 3 ** 2, y - 4 ** 2, z - 5 ** 2
print(x, y, z)

 

 

15 / 15

Q. 45
What is the output of following Python code?

my_list = [1, 2, 3, ]
print(len(my_list))

 

 

Your score is

0%