Q. A store charges RS 120 per item if you buy less than 10 items. If you buy between 10 and 99 items ,the cost is RS100 per item . if you buy more items, The cost is RS 70 the user how many items they are buying and print the total cost.


You can understand by Watching video :-



Answer :-

item = int(input("Enter the total number of items = "))

if item < 10 :
  print("Total cost = ",item * 120 , "rs")
elif 10 <= item and item <= 99 :
  print("Total cost = ",item * 100, "rs")
else :
  print("Total cost = ",item * 70 , "rs")

Output :-

Enter the total number of items = 5
Total cost =  600 rs
>>>

Enter the total number of items = 12
Total cost =  1200 rs

>>> 

Enter the total number of items = 155
Total cost =  10850 rs

>>>

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post