-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday_2.py
More file actions
43 lines (35 loc) · 1.33 KB
/
day_2.py
File metadata and controls
43 lines (35 loc) · 1.33 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
# DZIEŃ DRUGI____________________________________________________________________________________________________________________________________
# Data types
# print("Hello" [3]) SUBSCRIPTING A CHARACTER
# num_char = len(input("what is your name?: "))
# new_num_char = str(num_char)
# print("your name has " + new_num_char + " characters")
# two_digit_number = input("Type a two digit number: ")
# new_number = int(two_digit_number[0]) + int(two_digit_number[1])
# print(new_number)
# Matematical operations
# 1 + 3
# 3 - 2
# 2 * 5
# 6 / 3
# 2 ** 3 potega exponent operator
# height = input("enter your height in m: ")
# weight = input("enter your weight in kg: ")
# h = float(height)
# w = float(weight)
# bmi = w/h**2
# result = int(bmi)
# print(result)
# age = input("What is your current age? ")
# left = 90 - int(age)
# days = 365 * left
# weeks = 52 * left
# months = 12 * left
# print(f"You have {days} days, {weeks} weeks, and {months} months left.")
# print("Welcomme to the tip calculator.")
# bill = float(input("What was the total bill? $"))
# tip = int(input("What percentage tip would you like to give? 10, 12, or 15? "))
# ppl = int(input("How many people to split the bill? "))
# to_pay = round(bill/ppl * (1 + tip / 100), 2)
# #pay = round(to_pay, 2)
# print(f"Each person should pay: ${to_pay}.")