Professional Documents
Culture Documents
print ("Hello")
print ('Hello')
String Concatenations
using +;
print ('Hi' + 'there')
print ('Hi' + ' there')
print (int('8') + 5)
print (int('8.5') + 5)
print (float('8.5') + 5)
Strings can be added;
firstName = "Bola "
print (firstName + "Ige")
print (firstName)
print (firstName)
name = "Jide"
print (name * 5)
BASIC MATHEMATICS
1 + 3
3 - 1
4 * 4
5 / 2
5 // 2
3 / 34
4 ** 4
18 % 4
VARIABLES
exampleVar = 55
print (exampleVar)
print (exampleVar + 32)
exampleVar = 55 + 32
print (exampleVar)
exampleVar2 = 'whoa!'
print(exampleVar)
exampleVar
exampleVar2
Slicing up Strings
user = "Shegu Ola"
user[0]
print (user)
print (user[2])
print (user[-1])
print (user[2:7])
print (user[ : 7])
print (user[2 : ])
print (user[ : ])
print (len(user))