Computer Science, asked by kaushalkumar977106, 8 months ago

Write indented and documented program in Python for the following:
(a) To enter a number and check whether it is even or odd.
b) To enter three numbers and print the smallest among them.
c) To calculate simple interest,if the time is less than 5 years then the rate of interest will be 6% otherwise it will be 6.5%.
d) To display the colours of rainbow as per the user's choice.

Answers

Answered by imtiyazallam
13

Answer:

program 1

#input

n = int(input("Enter a Number: "))

#processing and output

if(n > 0):

   print("The number is even")

elif(n == 0):

   print("The number is equal to zero")

else:

   print("The number is odd")

program 2

#input

a = int(input("Enter 1st number: "))

b = int(input("Enter 2nd number: "))

c = int(input("Enter 3rd number: "))

#processing and output

if(a < b and a < c):

   print("1st number is smallest.")

elif(b < c):

   print("2nd number is smallest.")

else:

   print("3rd number is smallest.")

program 3

#input

p = float(input("Enter principle: "))

t = float(input("Enter time in years: "))

r = 6.5

#processing

if(t < 5):

   r = 6.0

i = (p * r * t)/100

#output

print("Interest:", i)

I can't understand the 4th question

Answered by pragyajha666
0

Answer:

oaiegrgtifochegwsoeheisowoebhdwog2u%sdskwoqpoweoru&÷=_₹^÷^÷^×[#[₹&₹;₹;&&■\£\£\■\《》●》●¥¥¤£●♤●♤|♤●££dhdjeggesiowf

Similar questions