Skip to content

Commit 0e7ec22

Browse files
Create Functions Exp.py
When you get bored, try these functions experiments out.
1 parent 07030e1 commit 0e7ec22

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Functions Exp.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# For when you get bored, try these two Python programming experiments out.
2+
3+
def get_value(name,program,book,author='by Joseph C. Richardson'):
4+
return name,program,book,author,'is GREAT!'
5+
6+
get_name=get_value('Python','Programmer\'s','Glossary Bible')
7+
8+
for i in get_name:
9+
print(i,end=' ')
10+
11+
# Try this global variables function experiment out and see what happens
12+
# when you delete or comment out the 'science()' function call statement,
13+
# using the '#' in front of it like this: # science(), or simply delete it.
14+
15+
a,e='atom','electron'
16+
17+
def science():
18+
global a
19+
global e
20+
a,e='Albert','Einstein'
21+
22+
#science() # comment out, or delete this function call statement.
23+
24+
print(a,e)

0 commit comments

Comments
 (0)