-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.py
More file actions
99 lines (69 loc) · 2.13 KB
/
Copy pathcode.py
File metadata and controls
99 lines (69 loc) · 2.13 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
95
96
97
# conditional statment in python
# age = int(input("enter your age"))
# if age >= 18 :
# print("you can vote")
# print("you can drive")
# else :
# print("you can't vote")
# Traffic light
# color = input("inter the color : ")
# if color == "red":
# print("stop")
# elif color == "green":
# print("Go")
# elif color == "yellow":
# print("look")
# else :
# print("you enter invalid color")
# find the child adult and teenager
# age = int(input("enter your age :"))
# if age <= 13:
# print("you are child")
# elif age >= 13 and age < 18:
# print("you are teenager")
# elif age >18 :
# print("you are elder")
# else :
# print("you are not a human")
# simple program to login App or website
# username = input("enter your username :")
# password = input("enter your password :")
# if (username == "admin" and password == "pass"):
# print(" LOGIN SUCCESSFUL!")
# elif(username != "admin"):
# print("Wrong username")
# else :
# print("Wrong Password")
# program to check if a number are multiple of 5 or not
# n = int(input("enter the number"))
# if( n % 5 == 0):
# print("Multiple of 5")
# else :
# print("not mulltiple of 5")
# print if a number is odd or even
# n = int(input("enter the number :"))
# if(n % 2 == 0 ):
# print("Even number")
# else :
# print("Odd number")
# Nesting in conditional statment
# username = input("enter your username :")
# password = input("enter your password :")
# if (username == "admin" and password == "pass"):
# print(" LOGIN SUCCESSFUL!")
# else :
# if(username != "admin"):
# print("wrong username")
# else :
# print(" wrong password")
# Match case in python
color = input("enter the color")
match color :
case "green" :
print("go")
case "red" :
print("stop")
case "yellow" :
print("look")
case _:
print("wrong color")