-
Notifications
You must be signed in to change notification settings - Fork 0
/
Data_types.py
62 lines (50 loc) · 1.33 KB
/
Data_types.py
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
#FUNDAMENTAL DATA TYPES
#Data type is a value in python/store information
'''
1)int-integer
2)float
3)bool-bolean
4)str-string
5)list
6)tuple
7)set
*)dict-dictionary
'''
#CLASSES->CUSTOM DATA TYPE->WE CAN CREATE OUR OWN DATA TYPES IN PYTHON
#SPECIALIZED DATA TYPES->PACKAGES USED FROM LIBRARY->WE CAN ADD TO PYTHON USING MODULES
#None->Nothing
#1)INT AND FLOAT
#AN INTEGER IS A NUMBER->WE USE INTEGER TO PERFROM MATHEMATICAL OPERATIONS->WHOLE NUMBERS
'''
print(type(2+4))->integer
print(type(2-4))->integer
print(type(2*4))->integer
print(type(2/4))->float->FLAOTING POINT NUMBER->NUMBER WITH A DECIMAL POINT
'''
#FLOAT TAKES MORE SPACE IN MEMORY TO STORE RATHER THAN INTEGER
#FLOAT+FLOAT->OUTPUT->FLOAT
#INTEGER+FLOAT->OUTPUT->FLOAT
'''
print(2**2)->POWER
print(2//4)->RETURNS ROUNDED DOWN TO INTEGER
print(5%4)->REMAINDER OF THE DIVISION'''
#DATA TYPE->binary
#binary->return binary conversion of number
#print(bin(5))->output->0b101->0b represent its a binary number
#print(int("0b101",2))->binary number converted to integer
#STRING->PIECE OF TEXT->'',""
print(type("Hi"))
username="supecoder"
password="supersecert"
long_string='''
W0W
O O
---
'''
print(long_string)
first_name='Akshaj'
last_name='Agarwal'
full_name=first_name+" "+last_name
print(full_name)
#STRING CONCATENATION->ADDING STRINGS TOGETHER->ONly works with strings
print('akshaj'+ 5)