Skip to content

Commit ddb6ba9

Browse files
Day 7 - Functions & Python Modules
1 parent c93ca21 commit ddb6ba9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tutorial-reference/Day 7/main.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
def my_print(txt):
2+
print(txt)
3+
4+
5+
msg_template = """Hello {name},
6+
Thank you for joining {website}. We are very
7+
happy to have you with us.
8+
""" # .format(name="Justin", website='cfe.sh')
9+
10+
def format_msg(my_name="Justin", my_website="cfe.sh"):
11+
my_msg = msg_template.format(name=my_name, website=my_website)
12+
# print(my_msg)
13+
return my_msg
14+
15+
"""
16+
"{} {}".format("abc", 123)
17+
"{1} {0}".format("abc", 123)
18+
"{name} {number}".format(name="abc", number=123)
19+
20+
"{} {name} {number}".format("another", name="abc", number=123)
21+
22+
"""
23+
24+
25+
def base_function(*args, **kwargs):
26+
print(args, kwargs)
27+
28+

0 commit comments

Comments
 (0)