Skip to content

Commit 1f06bca

Browse files
python lists
1 parent 8a8ce9b commit 1f06bca

File tree

3 files changed

+84
-38
lines changed

3 files changed

+84
-38
lines changed

.idea/workspace.xml

Lines changed: 62 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

printFunction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
number = raw_input('enter number: ')
33
n=int(number)
44
for x in range(1,n+1):
5-
print (x, end = '')
5+
print (x, end='')

pythonLists.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
lstC = list()
2+
lst = list()
3+
commands = int(raw_input())
4+
for x in range (0,commands):
5+
command = raw_input()
6+
lstC = command.split()
7+
if lstC[0] == 'insert':
8+
lst.insert(int(lstC[1]), int(lstC[2]))
9+
elif lstC[0] == 'print':
10+
print lst
11+
elif lstC[0] == 'remove':
12+
lst.remove(int(lstC[1]))
13+
elif lstC[0] == 'append':
14+
lst.append(int(lstC[1]))
15+
elif lstC[0] == 'pop':
16+
lst.pop()
17+
elif lstC[0] == 'sort':
18+
lst.sort()
19+
elif lstC[0] == 'reverse':
20+
lst.reverse()
21+

0 commit comments

Comments
 (0)