-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy path214814455_assignment_1.py
More file actions
59 lines (33 loc) · 945 Bytes
/
214814455_assignment_1.py
File metadata and controls
59 lines (33 loc) · 945 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- coding: utf-8 -*-
"""214814455-Assignment 1.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1O0QuOyHb_How0gQkPUEn3gJpA1uW5-Yl
"""
s = 'fullstackslp'
print(s[0])
print(s[11])
print(s[4:9])
print(s[9:])
print(s[7:10])
reversedString = '' .join(reversed(s))
print(reversedString)
l = [3,7,[5,[1,4,'hello']]]
l[2][1][2] = 'goodbye'
print(l[2][1][2])
d1 = {'simple_key':'hello'}
print(d1['simple_key'])
d2 = {'k1':{'k2':'hello'}}
print(d2['k1']['k2'])
d3 = {'k1':[{'nest_key':['this is deep',['hello']]}]}
print(d3['k1'][0]['nest_key'][1])
mylist = [1,1,1,1,1,2,2,2,2,3,3,3,3]
newList = []
for mylist in mylist:
if mylist not in newList:
newList.append(mylist)
print(newList)
age = 45
name = "Kyle"
"Hello my dog's name is Kyle and he looks 45 years old"
print( "Hello my dog's name is {} and he looks {} years old " .format(name,age))