12. Quyidagi kod natijasini kо‘rsating.
def calculate (num1, num2=4):
res = num1 * num2
print(res)
calculate(5, 6)
A) 20;
B) dastur xatolik qaytaradi;
C) 30;
D) 40.
13. Berilgan shart rost bo‘lgan holda sikl
tanasi bajariladigan sikl turi berilgan qatorni aniqlang
a) For b) While c) If d) Else
14. Dastur natijasini kо‘rsating
for num in range(10, 14):
for i in range(2, num):
if num%i == 1:
print(num)
break
A) 10
11
12
13
B) 11
13
C) 10
11
D) 10
11
12
15.
Quyidagi kod natijasini kо‘rsating.
x = 100
y = 50
print(x and y)
A) True; B) 100; C) False; D) 50.
Savol
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
Javob
|
d
|
b
|
c
|
d
|
a
|
d
|
c
|
a
|
a
|
b
|
b
|
c
|
b
|
b
|
d
|
9-sinflar uchun IV chorak test I variant
1. Dastur natijasini kо‘rsating.
x = 0
a = 0
b = -5
if a > 0:
if b < 0:
x = x + 5
elif a > 5:
x = x + 4
else:
x = x + 3
else:
x = x + 2
print(x)
A) 2; B) 0; C) 3; D) 4.
2. Dastur natijasini kо‘rsating.
x = 0
while (x < 100):
x+=2
print(x)
A) 101; B) 99; C) 100; D) 98.
3. Dastur natijasini kо‘rsating
for num in range(2,-5,-1):
print(num, end=", ")
A) 2, 1, 0
B) 2, 1, 0, -1, -2, -3, -4, -5
C) 2, 1, 0, -1, -2, -3, -4
D) 1, 0, -1, -2, -3, -4
4. Dastur natijasini kо‘rsating.
var = 10
for i in range(10):
for j in range(2, 10, 1):
if var % 2 == 0:
continue
var += 1
var+=1
else:
var+=1
print(var)
A) 20; B) 21; C) 30; D) 10.
5. Dastur natijasini kо‘rsating.
x = 0
for i in range(10):
for j in range(-1, -10, -1):
x += 1
print(x)
A) 99; B) 90; C) 100; D) 85.
6. Quyidagi funksiyalardan qaysi biri
takrorlanuvchi obyektni qaytaradi?
A) len() B) xrange() C) range() D) ord()
7. Quyidagi kod natijasini kо‘rsating.
for i in range(10, 15, 1):
print( i, end=',')
A) 10, 11, 12, 13, 14,
B) 10, 11, 12, 13, 14, 15,
C) 9, 10, 11, 12, 13, 14,
D) 9, 10, 11, 12, 13, 14, 15,
8. Quyidagi kod natijasini kо‘rsating.
p, q, r = 10, 20 ,30
print(p, q, r)
A) 30 20 10
B) 10 20 30
C) Error: invalid syntax
D) 10 30 20
9. Quyidagi kod natijasini kо‘rsating:
def a(b, c, d): pass
A) ro‘yxatni e’lon qiladi va uni ishga
tushiradi;
B) hech narsa bajarmaydigan funksiyani
e’lon qiladi;
C) parametrlarni uzatadigan funksiyani
e’lon qiladi;
D) bo‘sh sinfni e’lon qiladi.
10. Quyidagi kod natijasini kо‘rsating.
def calculate (num1, num2=4):
res = num1 * num2
print(res)
calculate(5, 6)
A) 20;
B) dastur xatolik qaytaradi;
C) 30;
D) 40.
11. Faqat o‘zlari eʼlon qilingan qism dasturda faolbo‘ladigan o‘zgaruvchilar nima deb ataladi?
A) Global o’zgaruvchilar
B) Lokal o’zgaruvchilar
C) Rekursiv o’zgaruvchilar
D) Funksiya
12.Joriy siklni o‘tkazib yuborib,
keyingisiga o‘tuvchi operator bu –
A) continue B) break C) stop D) pause
13. Sikl ishini to‘xtatuvchi operator bu-
A)pause B) continue C) stop D) break
14. Berilgan shart rost bo‘lgan
holda sikl tanasi bajariladigan sikl turi berilgan qatorni aniqlang
A) For B) While C) If D) Else
15. Faqat takrorlanishlar soni oldindan maʼlum bo‘lganda foydalaniladigan siklni aniqlang.
a) While b) If c) Else d) For