Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

### CONDITIONS WILL MAKE YOU TAKE DECISIONS ###

print("Hello")
print("How are you?")
avg = 38
if avg >=40:
print("Congratulations on clearing class X examination")
print("Whats your plan?")

#print("Sorry, please try next time. Good luck")

print("Good Day!")
if avg >=40:
print("Congratulations on your success")
print("Whats your plan ahead?")
else:
print("Sorry, please try next time. Good luck")

'''
90% : A+
80 : A-
70: B+
60: B-
50: C+
40: C-
40: Failed / F
avg > 95 - president medal
'''
"""
"""
avg = 94
if avg>=90:
print("Grade: A+")
if avg >= 95:
print("You win President Medal")

elif avg>=80:
print("Grade: A-")
elif avg>=70:
print("Grade: B+")
elif avg>=60:
print("Grade: B-")
elif avg>=50:
print("Grade: C+")
elif avg>=40:
print("Grade: C-")
else:
print("Grade: F")
#######
num = int(input("Enter a number: "))
#check if the value entered by the users is positive or negative
if num>0:
print(f"{num} is positive number")
if num % 2 == 0:
print(f"{num} is an even number")
else:
print(f"{num} is an odd number")
elif num==0:
print(f"{num} is neither positive nor negative number")

else:
print(f"{num} is negative number")

num = int(input("Enter a number: "))


#check if the value entered by the users is positive or negative
if num>=0:
if num % 2 == 0:
print(f"{num} is an even number")
else:
print(f"{num} is an odd number")
if num==0:
print(f"{num} is neither positive nor negative number")
else:
print(f"{num} is positive number")
else:
print(f"{num} is negative number")

'''
Calculate on-road price of a vehicle:
P: 5% of Basic Cost + 1% of Weight + 1 % of Insurance
B: 10% of Basic Cost + 3% of Weight + 2 % of Insurance
Input type, weight and basic price
'''
type= input("Enter the type of the vehice (P: Private / B: Business): ")

if type=="P" or type=="B":
basic = int(input("Enter the cost of the vehicle: "))
weight = int(input("Enter the weight of the vehicle in kg: "))
b_pct, w_pct, ins_pct = 0, 0, 0
if type=="P":
b_pct, w_pct, ins_pct = 5, 1, 1
else:
b_pct, w_pct, ins_pct = 10, 3, 2

vehicle_tax = basic*b_pct/100
weight_tax = weight*w_pct/100
insurance = basic*ins_pct/100
on_road_cost = vehicle_tax+weight_tax+insurance+basic
print(f"You need to pay Weight Tax of {weight_tax}, Vehicle Tax of {vehicle_tax} and"
f"Insurance of {insurance} which makes the total on-road cost as {on_road_cost}")

else:
print("You have entered wrong vehicle type and we cant proceed further")
Basic Programming Approach:
https://www.scribd.com/document/669777655/Pseudocode-Book

Advance Programming Approach:


https://www.scribd.com/document/669472691/Flowchart-and-C-Programs

### LOOPS ###


# for loop - used when you know exactly how many times to repeat
# while loop - repeat untill the given condition
# range() - function generates a range of value
# range(start,stop,step): =start, <stop, increment ->step
# range(4,19,3): 4, 7,10, 13, 16
# range(start, stop): default increment is 1
# range(3,8): 3,4,5,6,7
# range(stop): default start =0, increment is 1
# range(5): 0,1,2,3,4

# FOR loop: example to run a loop 5 times


for counter in range(4,19,3):
print(counter)
print("================")
for i in range(3,8):
print(i)
print("===X==X===X==X==")
for var in range(5):
print(var)

You might also like