-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6th.py
More file actions
38 lines (31 loc) · 1.09 KB
/
Copy path6th.py
File metadata and controls
38 lines (31 loc) · 1.09 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
# productprice=float(input('Product amount is '))
# discount20=(20/100)*productprice
# discount10=(10/100)*productprice
# Final challenge
# Take product price
# If price > 5000 → 20% discount
# If price > 3000 → 10% discount
# Else → No discount
# Print final price using round()
# price=float(input('product price is '))
# discount1=20/100*price
# discount2=10/100*price
# if price>=5000:
# print(price-discount1)
# elif (price>=3000) and (price<5000):
# print(price-discount2)
# else:
# print('discount not applied')
# Ask the user to enter their birth year as a string. Convert it to an integer and calculate their age (assume the current year is 2026).
# Using comparison and logical operators, check if the person is both:
# * 18 years or older
# * Age less than or equal to 60
# Print the age and whether the person is in the “working age group”.
yearOfBirth=int(input('enter your birth year '))
currentyear=2026
age=currentyear-yearOfBirth
print(age)
if (age>=18) and (age<=60):
print('you are in the working age group')
else:
print('you are NOT working in age group')