CoCalc Public Files1 / 6 / 2021-01-13-084408.ipynbOpen with one click!
Author: ANGEL MORE
Compute Environment: Ubuntu 20.04 (Default)
In [1]:
#Strings "spider man"
'spider man'
In [2]:
a = "bat" b = "man"
In [3]:
a+b
'batman'
In [4]:
b+a
'manbat'
In [5]:
#Lists [1,2,3]
[1, 2, 3]
In [6]:
c = [1,2,3]
In [7]:
c
[1, 2, 3]
In [8]:
list_superheros = ["Spider Man", "Batman", "Thor", "Iron Man"]
In [9]:
list_superheros
['Spider Man', 'Batman', 'Thor', 'Iron Man']
In [10]:
list_superheros.append("Wonder Woman")
In [11]:
list_superheros
['Spider Man', 'Batman', 'Thor', 'Iron Man', 'Wonder Woman']
In [12]:
list_superheros[1] = "ManBat"
In [13]:
list_superheros
['Spider Man', 'ManBat', 'Thor', 'Iron Man', 'Wonder Woman']
In [16]:
#For Loops for item in [5,3,8]: print(item)
5 3 8
In [17]:
listserve = [10,20,30] index = 0 for item in listserve: listserve[index]= item/10 index = index + 1 print(listserve)
[1, 2, 3]
In [ ]: