Computer Science, asked by indusvalue7422, 11 months ago

Edhesive 3.4 code practice

Answers

Answered by Chiavang20
46

Answer: Question 1

import time

# Input yellow #

yellow = input("Enter yellow: ")

# If yellow #

if yellow == "yellow":

 print("Correct")

else:

 print("Nope")

 

Explanation:

Answered by ChhutiMistry1
1

Answer:

3.4 Answer of QUESTION 1 -

What color?

Green

Nope

yellow

Correct!

3.4 Answer of QUESTION 2 -

Numerator: 1

Denominator: 2

0.5

Explanation:

3.4 QUESTION 1 -

color = input("What color? ")

if (color == "yellow"):

print("Correct!")

else:

print("Nope")

3.4 QUESTION 2 -

num = int(input("Numerator: "))

den = int(input("Denominator: "))

if(den == 0):

print("Error - cannot divide by zero.")

else:

print(num/den)

#SPJ3

Similar questions