-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquiz1.py
31 lines (29 loc) · 865 Bytes
/
quiz1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 1. Write a program that takes in a user's age
# and checks if they are old enough to vote (18 years or older).
print('QUESTION 1')
print('What is your age?')
age = input()
if int(age) >= 18:
print('You are old enough to vote!')
else:
print('You are not old enough to vote.')
# 2. Write a program that takes in a number and
# checks if it is positive or negative.
print('QUESTION 2')
print('Enter a number:')
num = input()
if int(num) >= 0:
print('Your number is positive.')
else:
print('Your number is negative.')
# 3. Write a program that takes in two numbers
# and checks if the first number is greater than the second number.
print('QUESTION 3')
print('Enter number A:')
a = input()
print('Enter number B:')
b = input()
if int(a) > int(b):
print('Number A is greater than Number B.')
else:
print('Number B is greater than Number A.')