Skip to content
Snippets Groups Projects
Commit 4e345a82 authored by cprutean's avatar cprutean
Browse files

Upload New File

parent 3b8f2e98
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:059058d7 tags:
# Append Function
%% Cell type:code id:d0b2e63b tags:
``` python
"""
Demonstration of Append function that works for any variable type
"""
def append(first,second):
"""
A generic append function
"""
l = first + second
return l
def main():
# Form two lists
fl = [1,2,3,5]
sl = [6,7,8,9,10]
# Append with a function
nl = append(fl,sl)
print(str(fl))
print(sl)
print(str(nl))
# Can also be used to append any variable type
x = 10.0
y = 11.0
z = append(x,y)
print("Value of z is : " + str(z))
main()
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment