Python
يحدد هذا الاختبار مستوى معرفتك بلغة بايثون
زودنا بعلوماتك
1 / 16
1. What will be the output of the following code snippet?
a = [1, 2, 3, 4, 5]
sum = 0
for ele in a:
sum += ele
print(sum)
2 / 16
2. What will be the output of the following code snippet?
a = [1, 2, 3]
a = tuple(a)
a[0] = 2
print(a)
3 / 16
3. What will be the datatype of the var in the below code snippet?
var = 10
print(type(var))
var = "Hello"
4 / 16
4. Which of the following statements are used in Exception Handling in Python?
5 / 16
5. What will be the output of the following code snippet?
a = 3
b = 1
print(a, b)
a, b = b, a
6 / 16
6. What will be the output of the following code snippet?
def thrive(n):
if n % 15 == 0:
print("thrive", end = “ ”)
elif n % 3 != 0 and n % 5 != 0:
print("neither", end = “ ”)
elif n % 3 == 0:
print("three", end = “ ”)
elif n % 5 == 0:
print("five", end = “ ”)
thrive(35)
thrive(56)
thrive(15)
thrive(39)
7 / 16
7. What will be the output of the following code snippet?
def solve(a):
a = [1, 3, 5]
a = [2, 4, 6]
solve(a)
8 / 16
8. Which of the following is the proper syntax to check if a particular element is present in a list?
9 / 16
9. What will be the output of the following code snippet?
print(2**3 + (5 + 6)**(1 + 1))
10 / 16
10. Which of the following types of loops are not supported in Python?
11 / 16
11. What will be the output of the following code snippet?
def func():
global value
value = "Local"
value = "Global"
func()
print(value)
12 / 16
12. What will be the output of the following code snippet?
def solve(a, b):
return b if a == 0 else solve(b % a, a)
print(solve(20, 50))
13 / 16
13. What will be the output of the following code snippet?
print(type(5 / 2))
print(type(5 // 2))
14 / 16
14. How is a code block indicated in Python?
15 / 16
15. Which of the following concepts is not a part of Python?
16 / 16
16. What will be the output of the following code snippet?
count = 0
while(True):
if count % 3 == 0:
print(count, end = " ")
if(count > 15):
break;
count += 1
Your score is
نتمنى لك رحلة مهنية ممتعة!
شارك النتيجة أصدقائك