forked from linrakesh/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_defined_list.py
More file actions
32 lines (31 loc) · 918 Bytes
/
user_defined_list.py
File metadata and controls
32 lines (31 loc) · 918 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
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: acer
#
# Created: 01-02-2018
# Copyright: (c) acer 2018
# Licence: <your licence>
#-------------------------------------------------------------------------------
def main():
n = int(input ("Enter total no of items in List"))
list = []
while n!=0:
item = input("Enter list item")
list.append(item)
n= n-1
print("Here is your Generated List :")
print(list)
choice = input("Do you want to change ?")
if(choice =="yes"):
newitem = input("Enter current list item name")
list.remove(newitem)
newitem = input("Enter new list item name")
list.append(newitem)
print("Your final modified list ")
else:
print("Original List ")
print(list)
if __name__ == '__main__':
main()