-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlesson6.py
More file actions
58 lines (52 loc) · 1.27 KB
/
lesson6.py
File metadata and controls
58 lines (52 loc) · 1.27 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
""" Python If-Else Statements"""
""" The If Staetement """
print(" --- if statement --- ")
# num = int(input("Enter a number: "))
num = 6
if num%2==0:
print("Number is even")
""" Program to print the largest number """
# a = int(input("Enter a? "));
# b = int(input("Enter b? "));
# c = int(input("Enter c? "));
a=4
b=10
c=1
if a>b and a>c:
print(" a is the largest ")
if b>a and b>c:
print("b is the largest")
if c>a and c>b:
print("c is the largest")
""" The If-Else Statement"""
print(" --- if - else --- ")
age=10
# age = int(input("Enter your age: "))
if age>=18:
print("You are eligible to vote")
else:
print("You are not eligible to vote")
number = 7
if number%2==0:
print("Number is even")
else:
print("Number is odd")
""" The elif statement """
# marks = int(input("Enter Your marks: "))
marks = 90
if marks>=90 and marks<=100:
print(" You scored an A")
elif marks>=80 and marks<90:
print("You scored a B")
elif marks>=70 and marks<=79:
print("You scored a C")
elif marks>=60 and marks<=69:
print("You scored a D")
elif marks>=50 and marks<=59:
print("You scored an E")
elif marks>=40 and marks<=49:
print("You failed")
elif marks>=0 and marks<=39:
print("You will have a retake")
else:
print("You score is invalid invalid")