-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpart2data.py
More file actions
38 lines (31 loc) · 774 Bytes
/
part2data.py
File metadata and controls
38 lines (31 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
myStr = str("Hello {}")
print(myStr.format("Tiki"))
myInt = int(4)
myInt = 4
myList = ["Apples","Pears","Bananas",'Grapes',"Durians"]
'''myList = list()
sd;lfasdsa;lambda
;ldsafdsa;lk
kjsdflakf'''
myList.append("Rambutans")
#myList.sort()
myList.reverse()
myList.insert(2,"Pears")
myList[3] = "Cherries"
fruitIndex = myList.index("Pears",4)
myList[fruitIndex] = "Manggoes"
myList.remove("Rambutans")
del myList[-1]
print(myList)
#print(myList.index("Blah"))
print("-"*50)
myTuple = ('Tiki Shabudin',46,"I'm hungry")
print(myTuple.index(46))
print(myTuple[0])
#myTuple = tuple()
myTuple = ("Tikriti Shabudin", 46, "Male",['apples','bananas'])
myTuple[3].append("whatever")
print(myTuple)
name,age,gender,fav_fruits = myTuple
myTuple = (name,age,gender)
print(myTuple)