x = 75
print(x)
75
x = x + 10
print(x)
85
# booleans: True, False
# and, or, not
# numbers: 10, 75, -65, 9.23, ....
# +, -, *, /, //, %
# strings: 'John','Computers',....
# many operations!!
x = 2**3
print(x)
8
True and True
True
False and True
False
True or True
True
False or True
True
False or False
False
not True
False
7 / 3
2.3333333333333335
7//3
2
7%3 # 7 mod 3
1
s1 = 'Computers'
s2 = 'are'
s3 = 'fantastic'
len(s1)
9
len(s2)
3
s1[6]
'e'
s1[3:7]
'pute'
s1[3:]
'puters'
s1[:3]
'Com'
s1[:]
'Computers'
s1.find('e')
6
s1.find('pute')
3
s1+s2
'Computersare'
s1 + ' ' + s2 + ' ' + s3 + '.'
'Computers are fantastic.'
s4 = '10,20,30,40,50'
s4.split(',')
['10', '20', '30', '40', '50']
s5 = '''
hello
how
are
you
'''
s5
'\nhello\nhow\nare\nyou\n'