6
6
7
7
AGE = 40
8
8
9
- print (f "If-example" )
9
+ print ("If-example" )
10
10
AGE = 18
11
11
if AGE >= 18 :
12
12
print ("You are eligible to vote." )
13
13
14
- print (f "======================================================" )
15
-
14
+ print ("======================================================" )
15
+ print ()
16
16
17
- print (f "If-else-example" )
18
- print (f "Hospital admission when the age is { AGE } " )
17
+ print ("If-else-example" )
18
+ print ("Hospital admission when the age is {AGE}" )
19
19
20
20
if AGE <= 18 :
21
21
print ("You should be admitted to the Pediatric Department." )
22
22
else :
23
23
print ("You should be admitted to the Adult Department." )
24
24
print (f"======================================================" )
25
+ print ()
25
26
26
- print (f "If-else-with-multiple-lines-example" )
27
+ print ("If-else-with-multiple-lines-example" )
27
28
print (f"Hospital admission when the age is { AGE } " )
28
29
29
30
if AGE <= 18 :
32
33
else :
33
34
print (f"Your age is { AGE } ." )
34
35
print ("You should be admitted to the Adult Department." )
35
- print (f"======================================================" )
36
+ print ("======================================================" )
37
+ print ()
36
38
37
39
print ("if-elif-else example" )
38
-
39
40
print ("elif = else if" )
40
41
41
42
MARKS = 85
48
49
else :
49
50
print ("Grade: D" )
50
51
print (f"======================================================" )
51
-
52
+ print ()
52
53
53
54
print ("Nested if Statements example" )
54
55
62
63
print ("Negative number" )
63
64
64
65
print (f"======================================================" )
65
-
66
+ print ()
66
67
67
68
print ("Using Logical Operators example" )
68
69
71
72
has_id = True
72
73
73
74
if AGE >= 18 and has_id :
74
- print (f "You can enter the club, as your age is { AGE } ." )
75
+ print ("You can enter the club, as your age is {AGE}." )
75
76
else :
76
- print (f "Entry denied, as your age is { AGE } ." )
77
+ print ("Entry denied, as your age is {AGE}." )
77
78
78
79
79
- print (f "======================================================" )
80
+ print ("======================================================" )
0 commit comments