Computer Science, asked by Aurora34, 1 year ago

»Question based on computer science(Python)



» Answer Q4, a,b,c and d part.

[I request to give right answers, urgently needed. ]

Attachments:

Answers

Answered by BrainlyYoda
15

Answer:

(a)

num1 = float(input("Enter first number: "))

num2 = float(input("Enter second number: "))

num3 = float(input("Enter third number: "))

if (num1 > num2) and (num1 > num3):

  largest = num1

elif (num2 > num1) and (num2 > num3):

  largest = num2

else:

  largest = num3

print("The largest number is ", largest)

(b)

principal = float(input("Enter the principal amount:"))

time = int(input("Enter the time(years): "))

rate = float(input("Enter the rate: "))

simple_interest = (principal*time*rate)/100

print("The simple interest is: ",simple_interest)

(c)

num = int(input("Enter age: "))

if (age>=18) :

  print("{0} is Eligible to vote".format(num))

else:

  print("{0} is not eligible to vote ".format(num))

(d)

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

if (num % 2) == 0:

  print("{0} is Even ".format(num))

else:

  print("{0} is Odd ".format(num))


BrainlyYoda: Which program you typed?
Aurora34: i think you've put wrong indentation, there are certain rules while running a program
Aurora34: #ajayrawat
BrainlyYoda: Yeah right in python indentation is mandatory
BrainlyYoda: Actually I am trying to give space here but its not happening
BrainlyYoda: That's what I am not able to do . I will try that tomorrow if I can
BrainlyYoda: Sorry its not happening I tried just now.
Similar questions