2.4 Lets start with Colab notebooks
Please try the following:
Printing to screen
print('Hello World! '*10)
## Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World!
Maths
1+1
## 2
## 2
Modules
sqrt(9)
Error!
import numpy as np # Let's add functionality by importing a package called numpy
np.sqrt(9) # Lets try again
## 3.0
## 3.0
Lists
names = ['Yih-Cherng','Chammika','Zhi Han','Linda','Robert','Max','Hai Xiang','Jing Xian']
Example 1
names[3]
## 'Linda'
## Linda
Example 2
names[0]
## 'Yih-Cherng'
## Yih-Cherng
Example 3
names[-1]
## 'Jing Xian'
## Jing Xian
Example 4
names[0].upper()
## 'YIH-CHERNG'
## YIH-CHERNG
Example 5
names[0].lower()
## 'yih-cherng'
## yih-cherng