-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz
More file actions
40 lines (33 loc) · 1.05 KB
/
quiz
File metadata and controls
40 lines (33 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#gonderilen bir kelimeyi belirtilen kez ekrana yazan kod
def ekranayazanfonk(kelime,sayi):
for i in range (0,sayi):
print(kelime)
ekranayazanfonk("dogukan",5)
#kendisine gonderilen sınırsız sayidaki parametreyi listeye ceviren fonksiyon
def turnToList(*params):
liste = []
for param in params:
liste.append(param)
return liste
result=turnToList(10,20,30,"merhaba")
print(result)
#gonderilen 2 sayı arasındaki tum asal sayıları bulun
def AsalBulan(sayi1,sayi2):
for num in range(sayi1,sayi2+1):
if sayi>1:
for i in range(2,num):
if(num%i==0):
break
else:
print(num)
sayi=int(input("lutfen 1.sayiyi giriniz:"))
ssayi=int(input("lutfen 2.sayiyi giriniz"))
AsalBulan(sayi,ssayi)
#kendisine gonderilen sayinin tam bolenlerini liste seklinde geri donduren fonk
def tam_bolenleri_bul(sayi):
tambolenler=[]
for i in range (2,sayi):
if(sayi%i==0):
tambolenler.append(i)
return tambolenler
print(tam_bolenleri_bul(20))