-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
98 lines (82 loc) · 1.41 KB
/
test.py
File metadata and controls
98 lines (82 loc) · 1.41 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
'''
Created on
Course work:
@author: Elakia VM
Source:
'''
def startpy():
"""
BASIC- I
"""
# this is for seeing the version
import sys
print(sys.version)
print(sys.version_info)
""" this is the multi lines comments
sys.version shows the version of the python
"""
"""
Casting
If u want to specify the type of a variable
"""
x = str(3)
y = int(3)
z = float(3)
print(x) #x = '3'
print(y)
print(z)
"""
Get the Type
show what is the variable
"""
print(type(x))
print(type(y))
print(type(z))
"""
Quotes
variable can be declare in the (" ",' ')
"""
x = "John"
print(x)
x = 'John'
print(x)
"""
Case-Sensitive Variable
"""
a = 34
A = "hi"
print(a)
print(A)
# Camel Case
myVarVal = 34
#Pascal Case
MyVarVal = 23
#Snake Case
my_var_name = 67
"""
Many variable accessing
"""
x,y,z = 3,4,5
print(x,y,z)
"""
One value for multiple variables
"""
x = y = z = 34
print(x,y,z)
"""
Unpackage a collection
"""
a = ['john','raji','sara']
x, y, z = a
print(x,y,z)
"""
Output Variable
"""
x = "Hello World statement"
print("Hello " in x)
y = "printed"
print(x + y)
z = 5
print(x + y + str(z))
if __name__ == '__main__':
startpy()