-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay2.py
More file actions
79 lines (51 loc) · 1.66 KB
/
Day2.py
File metadata and controls
79 lines (51 loc) · 1.66 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
# Data Types, Numbers, Operations, Type Conversions, f-string
# "String"
# print("Hello"[0:3])
# print("123" + "345")
# # integer
# print(123 + 456)
# # Float
# print(3.143223)
# Boolean True:False
# num = input("Enter Two Digit Number: ")
# Mathematical Operation in Python
# PEMDAS LR (), **, *, /, +, -
# print(2/2*2**2+2-2/(4+5))
# # BMI Calculator
# height = (input("Enter Your Height in m: "))
# weight = (input("Enter Your Weight in kg: "))
# bmi = float(weight) / (float(height)**2)
# print("Your BMI result is: "+str(bmi))
# print(round(8/3,5))
# print( type(8 // 3))
# print(type(4/2))
# score = 1
# # User scores a point
# score += 3
# print(score)
# score = 2
# height = 1.8
# isWinning = True
# print(f"Score is {score}")
# Left Life Days, Weeks and months Calculator
# age = int(input("Enter Your Current Age: "))
# days = age * 365
# weeks = age * 52
# months = age * 12
# print(f"Your age is {days}, {weeks}, {months}")
# live_life = 100
# live_days = (live_life*365)-days
# live_weeks = (live_life*52)-weeks
# live_months = (live_life*12)-months
# print(f"Your Left Life is {live_days}, {live_weeks}, {live_months}")
# Bill Split Calculator
print("Welcome")
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_amouont = "{:.2f}".format(bill_per_person,2)
print(f"Each person should pay: {final_amouont}")