mantion
Kilopat
- Katılım
- 1 Nisan 2018
- Mesajlar
- 2.116
- Makaleler
- 1
- Çözümler
- 7
Daha fazla
- Cinsiyet
- Erkek
Merhaba, bu iki kodun arasındaki farkı malum kişiye anlatır gibi anlatabilir misiniz? Kısa olanı ben yazdım uzun olan takip ettiğim kurstan ama kendi yazdığım daha mantıklı geldi.
Python:
print("Welcome to the tip calculator!")
bill = float(input("What was the total bill? $"))
tip = int(input("How much tip would you like to give? 10, 12, or 15? "))
people = int(input("How many people to split the bill?"))
tip_as_percent = tip / 100
total_tip_amount = bill * tip_as_percent
total_bill = bill + total_tip_amount
bill_per_person = total_bill / people
final_amount = round(bill_per_person, 2)
print(f"Each person should pay: ${final_amount}")
Python:
print("Welcome to the tip calculator")
bill = float(input("Enter the total bill amount $"))
tip = int(input("How much tip would you like to leave ten / twelve / fifteen\n"))
people = int(input("How many people will split the bill\n"))
bill_with_tip = bill / tip + bill
final = bill_with_tip / people
print(f"Each person should pay ${final}")
Son düzenleyen: Moderatör: