Python Exam Questions (1-65) With
Complete Solutions
1. Which of the following data types are supported in Python? -
| | | | | | | | | | | |
CORRECT ANSWER✔✔-The following data type are *Supported*:
| | | | | |
1 - Numbers
| |
2 - String
| |
3 - List
| |
4 - Tuples
| | |
5 - Dictionary
| |
2. Which of the following data types are *not* supported in Python? -
| | | | | | | | | | | | |
CORRECT ANSWER✔✔-Slice
|
3. What is the output of print(str) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | |
ANSWER✔✔-Hello World! |
4. What is the output of print(str[0]) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | |
ANSWER✔✔-H
, 5. What is the output of print(str[2:5]) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | |
ANSWER✔✔-llo
6. What is the output of print(str[2:]) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | |
ANSWER✔✔-llo World! |
7. What is the output of print(str * 2) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | | | |
ANSWER✔✔-Hello World!Hello World! | |
8. What is the output of print(list) if list=[ 'abcd', 786 , 2.23]? - CORRECT
| | | | | | | | | | | | | | |
ANSWER✔✔-['abcd', 786 , 2.23] | | |
9. What is the output of print(list[0]) if list =[ 'abcd', 786 , 2.23]? -
| | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-abcd
|
10. What is the output of print(list[1:3]) if list=[ 'abcd', 786 , 2.23]? -
| | | | | | | | | | | | | |
CORRECT ANSWER✔✔-[786, 2.23]
| |
11. What is the output of print(list[2:]) if list=[ 'abcd',786, 2.23]? -
| | | | | | | | | | | |
CORRECT ANSWER✔✔-[2.23]
|
12. What is the output of print (tinylist * 2) if tinylist = [123, 'john']? -
| | | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-[123, 'john',123, 'john']
| | |
Complete Solutions
1. Which of the following data types are supported in Python? -
| | | | | | | | | | | |
CORRECT ANSWER✔✔-The following data type are *Supported*:
| | | | | |
1 - Numbers
| |
2 - String
| |
3 - List
| |
4 - Tuples
| | |
5 - Dictionary
| |
2. Which of the following data types are *not* supported in Python? -
| | | | | | | | | | | | |
CORRECT ANSWER✔✔-Slice
|
3. What is the output of print(str) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | |
ANSWER✔✔-Hello World! |
4. What is the output of print(str[0]) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | |
ANSWER✔✔-H
, 5. What is the output of print(str[2:5]) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | |
ANSWER✔✔-llo
6. What is the output of print(str[2:]) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | |
ANSWER✔✔-llo World! |
7. What is the output of print(str * 2) if str = 'Hello World!'? - CORRECT
| | | | | | | | | | | | | | | |
ANSWER✔✔-Hello World!Hello World! | |
8. What is the output of print(list) if list=[ 'abcd', 786 , 2.23]? - CORRECT
| | | | | | | | | | | | | | |
ANSWER✔✔-['abcd', 786 , 2.23] | | |
9. What is the output of print(list[0]) if list =[ 'abcd', 786 , 2.23]? -
| | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-abcd
|
10. What is the output of print(list[1:3]) if list=[ 'abcd', 786 , 2.23]? -
| | | | | | | | | | | | | |
CORRECT ANSWER✔✔-[786, 2.23]
| |
11. What is the output of print(list[2:]) if list=[ 'abcd',786, 2.23]? -
| | | | | | | | | | | |
CORRECT ANSWER✔✔-[2.23]
|
12. What is the output of print (tinylist * 2) if tinylist = [123, 'john']? -
| | | | | | | | | | | | | | | |
CORRECT ANSWER✔✔-[123, 'john',123, 'john']
| | |