Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_total(list):
- total=0
- copy=list
- while(len(copy) > 0):
- total=total+copy.pop(0)
- return total
- def make_list():
- list=[1,2,3,4,5]
- print("total is ", get_total(list))
- print("list is", list)
- make_list()
- total is 15
- list is []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement