-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnot_functionodev.py
More file actions
55 lines (37 loc) · 1.2 KB
/
Copy pathnot_functionodev.py
File metadata and controls
55 lines (37 loc) · 1.2 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
41
42
43
44
45
# 1- Göderilen bir kelimeyi belirtilen kez ekranda gösteren fonksiyonu yazın.
# def yazdır(kelime,adet):
# print(kelime*adet)
# yazdır("merhaba\n",10)
# 2- Kendine göderilen sınırsız sayıdaki parametreyi bir listeye çeviren fonksiyonu yazın.
# def listeyeCevır(*veri):
# liste = []
# for i in veri:
# liste.append(i)
# return liste
# result = listeyeCevır(1,2,3,"haelo","meraba")
# print(result)
# 3- Gönderilen 2 sayı arasındaki tüm asal sayıları bulun.
# def asalbul(x,y):
# liste = []
# for sayi in range(sayi1,sayi2+1):
# if sayi>1:
# for i in range(2,sayi):
# if sayi%i == 0:
# break
# else:
# liste.append(sayi)
# return liste
# sayi1 = int(input("Sayı 1: "))
# sayi2 = int(input("Sayı 2: "))
# result = asalbul(sayi1,sayi2)
# print(result)
# 4- Kendisine gönderilen bir sayının tam bölenlerini bir liste şeklinde döndür.
def tamBolenleriBul(x):
bolenlist =[]
for i in range(2,sayı):
if sayı%i==0:
bolenlist.append(i)
return bolenlist
sayı=int(input("bir sayı gir: "))
result = tamBolenleriBul(sayı)
print