-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathAnswers
More file actions
147 lines (101 loc) · 2.98 KB
/
Answers
File metadata and controls
147 lines (101 loc) · 2.98 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#Soru 1:
for i in range(1, 11):
print(i)
#Soru 2:
sayi = int(input("Bir sayı girin: "))
print("for döngüsü ile çift sayılar:")
for i in range(2, sayi + 1, 2):
print(i)
sayi = int(input("Bir sayı girin: "))
print("while döngüsü ile çift sayılar:")
i = 2
while i <= sayi:
print(i)
i += 2
#Soru 3:
num1= int(input("Please enter the first nummer:"))
num2= int(input("Please enter the second nummer:"))
between_num=[]
for cifer in range(num1,num2+1):
if cifer >= num1 and cifer<=num2:
between_num.append(cifer)
print("Between Nummer 1 and Nummer 2 :", between_num)
#Soru 4:
nummer= int(input("Please Enter A Nummer:"))
if nummer %2 == 1:
print("The NUmmer {} is an odd nummer".format(nummer))
else:
print("The Nummer {} is an even nummer".format(nummer))
#Soru 5:
sayi = int(input("pozitif tam sayi giriniz:"))
x=1
for i in range (1,sayi+1):
x *= i
print(f"Faktoriyel = {x} ")
#Soru 6:
sayi = int(input("bir sayi giriniz: "))
for i in range(2,sayi):
if sayi % i == 0 :
print(f"{sayi} sayisi asal degildir")
break
else:
print(f"{sayi} asal bir sayidir.")
#Soru 7:
sinirsayisi= int(input("Fibonacci dizisindeki sonsayiyi belirleyin: "))
fibonacci = [0, 1]
while fibonacci[-1] + fibonacci[-2] <= sinirsayisi:
sonrakisayi = fibonacci[-1] + fibonacci[-2]
fibonacci.append(sonrakisayi)
print(f"Fibonacci dizisi sinirsayisi {sinirsayisi}:")
print(fibonacci)
#Soru 8:
text= input("Please enter a text:")
new_words= text[::-1]
print(new_words)
#Soru 9:
text = input("Lütfen bir metin giriniz: ")
new_text = "".join(word[::-1] for word in text)
print("Bu metnin tersi:", new_text)
if text.lower() == new_text.lower():
print("Bu metin bir palindromdur.")
else:
print("Bu metin bir palindrom değildir.")
#Soru 10:
weight= int(input("Please enter your weight(kg):"))
height=int(input("Please enter your height(cm):"))
indeks= weight/(height/100)**2
indeks=round(indeks,2)
print(indeks)
if indeks <25 :
print("zayıf")
elif 25<=indeks<30:
print("Normal")
elif 30<=indeks<40:
print("Kilolu")
elif 40<= indeks:
print("Aşırı Kilolu")
#Soru 11:
sayi1 = float(input("Birinci sayıyı girin: "))
sayi2 = float(input("İkinci sayıyı girin: "))
sayi3 = float(input("Üçüncü sayıyı girin: "))
en_buyuk = sayi1
if sayi2 > en_buyuk:
en_buyuk = sayi2
if sayi3 > en_buyuk:
en_buyuk = sayi3
print("En büyük sayı:", en_buyuk)
#Soru 12:
for i in range(1,5):
print(f" {i}. Ders için notları giriniz!")
vize_notu= float(input("Vize Notunu Giriniz:"))
final_notu=float(input("Final Notunu Giriniz:"))
ortalama= vize_notu*0.4 + final_notu*0.6
if 50 <= ortalama <= 100:
print(f" {i}. Ders Not Ortalaması. {ortalama} - BAŞARILI")
print("*"*115)
elif 0<= ortalama <50 :
print(f" {i}. Ders Not Ortalaması: {ortalama} - BAŞARISIZ")
print("*" * 115)
else:
print("Yanlış Değer Girdiniz Lütfen Tekrar Giriniz.")
print("*" * 115)