Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions week1_beden_kitle_indeksi_hesaplama
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 17 20:48:46 2021

@author: amsterdam
"""

print("VÜCUT KİTLE ENDEKSİ HESAPLAMA PROGRAMI 💪")
boy = float(input("Boy (m):"))
kilo = int(input("Kilo (kg):"))

endeks = kilo/(boy*boy)

if endeks <25:
print("\n zayıf VKİ:{}".format(endeks))
elif endeks >= 25 and endeks <30:
print("\n fazla kilolu VKİ:{}".format(endeks))
elif endeks >= 30 and endeks <40:
print("\n obez VKİ:{}".format(endeks))
else:
print("\n ciddi obez VKİ:{}".format(endeks))
16 changes: 16 additions & 0 deletions week1_ders_puani_hesaplama
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 17 20:40:40 2021

@author: amsterdam
"""

vize = input('Vize Notunuz : ')
final = input('Final Notunuz : ')
ortalama=(float(vize)*0.4)+(float(final)*0.6)
print("Ortalama :{0} ".format(ortalama))
if(ortalama<50):
print("Kaldınız")
else:
print("Geçtiniz")
81 changes: 81 additions & 0 deletions week1_rock_paper_scissor
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
### Tas kagit makas programi yazmaya calistim
#### Kullanicidan bu seceneklerden birini aliyoruz
#####Bilgisayara karsi bir cevap almaya calisiyoruz
######Cevaplara gore bir puanlama olusturduk


import random

input("Welcome to Rock, Paper, Scissors! Press enter to start. ")

user_score=0 #kullanici skorunu belirtir
cpu_score=0 # vilgisayarin skorunu belirtir



while True:
print()
user_choice = input("Rock, Paper, or Scissors?").lower() # seceneklerden birini yazmasini istiyoruz.
while user_choice != "rock" and user_choice!="paper" and user_choice!="scissors":
user_choice=input("Invalid input, please try again: ").lower()

random_num=random.randint(0,2) #bilgisayardan randint fonk ile bu aralikta rastgele tam sayi atamasini istiyoruz.
if random_num == 0: #bu sayilari kullanicidan bekledigimiz cevaplara tanimliyoruz.
cpu_choice="rock"
elif random_num == 1:
cpu_choice="paper"
elif random_num == 2:
cpu_choice="scissors"


print()
print("Your choice : ", user_choice)
print("Computer's choice : ", cpu_choice)
print()


if user_choice=="rock": #kosul blogu ile olasi durumlari siralayip puanlamayi ayarliyoruz
if cpu_choice== "rock":
print("It's a tie!")
elif cpu_choice== "paper":
print("You lost")
cpu_score += 1
elif cpu_choice== "scissors":
print("You win")
user_score+=1
elif user_choice=="paper":
if cpu_choice== "paper":
print("It's a tie!")
elif cpu_choice== "scissors":
print("You lost")
cpu_score+=1
elif cpu_choice== "rock":
print("You win")
user_score+=1
elif user_choice=="scissors":
if cpu_choice== "scissors":
print("It's a tie!")
elif cpu_choice== "rock":
print("You lost")
cpu_score+=1
elif cpu_choice== "paper":
print("You win")
user_score+=1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 tane if else condition dongusu yerine ilk basta eger ayni ise tie degilse diger 6 conditiona cevirip condition dongusunu 6ya indirebilirsiniz.


print()
print("You have ", user_score, " wins") #kullanici ve pc skorlarini yazdirdik
print("Computer have ", cpu_score, " wins")
print()

repeat= input("Play Again? (Y/N)").lower() #kullanicinin donguyu basa almak isteyip istemedigini soruyoruz
while repeat != "n" and repeat != "y":
repeat=input("Invalid input, please try again:").lower()
Comment on lines +70 to +72
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeating code?


repeat= input("Play Again? (Y/N)").lower
while repeat != "n" and repeat != "y":
repeat=input("Invalid input, please try again:").lower() #gecersiz bir komut varsa kullanicinin duzeltmesini istiyoruz
Comment on lines +74 to +76
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?


if repeat =="n":
break # donguyu sonlandiriyoruz

print("\n.................\n ")