-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatatypes_one.py
78 lines (53 loc) · 956 Bytes
/
datatypes_one.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
####### OPERATOTS ##############
'''
x = True
y = False
print x or y
print x and y
print not x
a = 3
b = 7
c = a|b
print c
c = a&b
print c
c = a^b
print c
'''
'''
print(9 << 1)
print(9 >> 1)
x = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
print('n' in x)
print('n' not in x)
'''
#############END OPERATORS ###############
########### DATA TYPES ####################
# Python supports 3 types of numeric datatypes..
#Integer
#Float and
#Complex
"""
a = ''' Hi..! I\'m Rajat.
I\'m 23 years old. '''
b = 'I\'m studying in MIT
print a[4:15]
print a*2
print (b[1:-4])
print(a.find('23'))
x = a.replace('years', 'yrs')
print x
x = a.split('::')
print x
print(a.count('a',0,-1))
print(a.upper())
print(min(b))
print(max(a))
"""
###### END STRING #####
##### TUPLES #####
# Tuple uses () to define elements
tup = ('Rajat', 'Sanket', 'Akshay', 'Swapnil')
# Concatination
#print(tup +('Vaibhav', 'Pratik', 'Harish'))
print tup * 2