-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathif_else.py
More file actions
94 lines (83 loc) · 2 KB
/
if_else.py
File metadata and controls
94 lines (83 loc) · 2 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
"""if elif-else conditional statments"""
# if 5<3:
# print("right")
# elif 10>45:
# print("rightt")
# elif 5==23:
# print("dfghjk")
# elif 5!=5:
# print("qwtyui")
# else:
# print("wrong")
# <,>,==,!=,<=,>=
# print("grade:")
# x = int(input())
# if x==0:
# print('Enter Valid marks')
# elif x>=90:
# print('A1')
# elif x>80:
# print('A')
# elif x>60:
# print('B')
# elif x>35:
# print('C')
# else:
# print('F')
# """nested if else"""
# grade = float(input("enter your grade:"))
# if grade > 80:
# print("A")
# else:
# if grade > 60:
# print("B")
# else:
# if grade > 40:
# print("C")
# else:
# print("Fail")
# x = int(input('enter the age:'))
# if 1<=x<18:
# print("Children")
# elif 18<=x<36:
# print("Mrg")
# elif 36<=x<58:
# print("kam")
# elif 58<=x<65:
# print("goa")
# elif 65<=x<73:
# print("temple")
# elif x>=73:
# print("Death")
"""ternary if else"""
# a,b = int(input())
# print(a,b)
a = float(input("Enter the value of A:"))
b = float(input("Enter the value of B:"))
print("A is equal to B" if a==b else "A is greater than B"if a>b else "B is greater than A")
""""odd-even"""
x = int(input("Enter any number:"))
if x%2==0:
print("The given number is Even.")
else:
print("The given number is Odd.")
"""revere"""
x = 'my class name is transglobe multimedia education campus'
print(x[0:2],x[7:2:-1]+x[8:13],x[15:13:-1]+x[16:27],x[37:27:-1]+x[38:48],x[54:48:-1])
"""Match-case"""
# x = int(input("Enter a number:"))
# y = int(input("Enter a number:"))
# value = (x!=y)
# match value:
# case True:
# print("x and y are not equal.")
# case False:
# print("x and y are equal.")
# name = input("What's your name:\n")
# match name:
# case "Harry"|"Hermione"|"Ron":
# print("Gryffindor")
# case "Draco":
# print("Slythrein")
# case _:
# print("Who?")