 Anyone Can Code.

## Tutorial 4: Quiz 2

### Question 3: What is the output of the following code?

``````
x = 99
y = -99
if (x+y) > 0:
print("Positive")
elif (x-y) =< 0:
print("Negative")
else:
print(0)
``````

### Question 5: What is the output of the following code?

``````
maths = 69
physics = 9
chemistry = 99
total = maths + physics + chemistry
if maths < 65 or physics < 55 or chem < 50 and total <= 160:
print("Fail")
else:
print("Pass")
``````

### Question 6: True or False: The output of the following code is 'Moderate'

``````
x = 24
y = -6
if y*4 == x:
print("Easy")
elif x+y >= x:
print("Moderate")
else:
print("Tough")
``````

### Question 7: What is the output of the following code? (If there are two outputs separate them by commas)

``````
x = 9
if x > 10.0 or x < 10.0:
print("Float")
if x > 8 and x < 10:
print(x)
else:
print("Integer")
``````

### Question 9: What is the output of the following code if 100 is entered as the units?

``````
units = int(input("Enter the units consumed: "))
cost = 75
if 0 <= units <= 100:
cost = cost + units*5
elif 100 < units <= 250:
cost = cost + 500 + (units-100)*10
elif units > 250:
cost = cost + 2000 + (units-250)*20
print(cost)
``````

Score =

## Next ❯

Copyright © 2020, Q-Programming | Created by Arjun Sodhi, Balpreet Juneja and Sammarth Kumar | Developed and Designed by Sammarth Kumar