-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.py
More file actions
25 lines (19 loc) · 707 Bytes
/
hello.py
File metadata and controls
25 lines (19 loc) · 707 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
import sys
# ========== Functions ==========
def Initialize(): # This function creates an empty list
Name = []
return Name
def SetParameter(name, arg): # If there are arguments, this function extends the list whith the arguments
name.extend(arg)
return name
def Print(name):
if len(name) == 1: # If there are no arguments, the length of "Name" list will be 1 (the filename)
print("Hello World!")
else: print("Hello" + " " + name[1] + "!")
# ========== Main ==========
Initialize()
Print(SetParameter(Initialize(), sys.argv))
'''
The Initialize function gives its parameter to the SetParameter,
then the SetParameter gives its parameter to the Print function
'''