Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 568
Image: ubuntu2004
Kernel: SageMath 9.2
#Strings "spider man"
'spider man'
a = "bat" b = "man"
a+b
'batman'
b+a
'manbat'
#Lists [1,2,3]
[1, 2, 3]
c = [1,2,3]
c
[1, 2, 3]
list_superheros = ["Spider Man", "Batman", "Thor", "Iron Man"]
list_superheros
['Spider Man', 'Batman', 'Thor', 'Iron Man']
list_superheros.append("Wonder Woman")
list_superheros
['Spider Man', 'Batman', 'Thor', 'Iron Man', 'Wonder Woman']
list_superheros[1] = "ManBat"
list_superheros
['Spider Man', 'ManBat', 'Thor', 'Iron Man', 'Wonder Woman']
#For Loops for item in [5,3,8]: print(item)
5 3 8
listserve = [10,20,30] index = 0 for item in listserve: listserve[index]= item/10 index = index + 1 print(listserve)
[1, 2, 3]