-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.py
More file actions
134 lines (85 loc) · 2 KB
/
Copy pathhello.py
File metadata and controls
134 lines (85 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
"""print ("hello world")
#variable
# variable menumber ka use nhi hota hai
#variable me special character ka bhi use nhi hota hai
#variable store kare wakt space ka use nhi kr sakte hai
var = 35
hello = 12
# 3 types of naming
#snakes case
#camel casing
#pascal case
employeeOne = 1 #camel case
EmployeeOne = 2 #pascal case
employee_one = 3 #snake case
#data types
# three major data types
#1 -Number-int,float,complex
#2-Strings--str
#3- Boolean
###Integer
a = 34
print(type(a))
##float
b = 0.4
c = 5/3
d = 12/2
print(type(b))
print(type(c))
print(type(d))
#complex
a = 12j
print(type(a))
##Strings
name = "Deepak kumar"
age = 21
print(type(name))
#Boolean
a = True
b = False
print(type(a))
print(type(b))
####practice
#1 accept number from a user
print("hello","world")"""
"""## comparison operator
##(==, > , <, >=, !=) -- this operator compare betwween two thing and they will always produce result in boolean
##!= -- not equal to
print(12 == 12)
print(12 == 12.1)
print(12 > 12.1)
print(12 <= 12)
print(12.1 != 12)
##logical operator
##(and,or,not)
##AND operator
print( 12 == 12 and 56 == 56 and 34 == 34 and 12>10)
print(12 == 12 and 56 == 56 and 34>78 and 12>10)
# all the operation must be true if a single operation is false the final result will also be false
## OR operator
print( 12 > 34 or 13 == 45 or 56 == 78 or 12 == 12)
print( 12 > 34 or 13 == 45 or 56 == 78 or 12 == 13)
## if any one of the operaotion is true the whole result will be true
## NOT operator
#print( 12 == 12)
print(not 12 == 12)
## it convert true to false and false to true
print(not(12 == 12 and 34 == 34)and (13 == 56 or 34 != 45))
print(bool(0) and 12 == 12)
a = 12
b = 56
print(a == b)"""
##control flow statement
##(if else, loops. functions)
## if
age = int(input("enter your age"))
## indention-- 5 space gap after pressing enter
#if True:
#print("my statementent is true")
if age >= 18:
print("you can vote")
#if age < 18:
else:
print("you cannot vote")
### 31.03.2026
# if(ans == "a"):