Question: def print_s(s): print a given string print(s) language == python (a) Define variable s in the cell below Take a look at the function print_s
def print_s(s):
"print a given string"
print(s)



language == python
(a) Define variable s in the cell below Take a look at the function print_s in HW1.py, and understand what that function does. In the cell below, define a string variable s such that print_s(s) prints: Tired : Doing math on your calculator. Wired : Doing math in Python. Inspired : Training literal pythons to carry out long division using an abacus. (b) Define function print_s_lines in HW1.py When print_s_lines (s) is run with the previously defined s, it should print: Tired Doing math on your calculator. Wired Doing math in Python. Inspired Training literal pythons to carry out long division using an abacus. (c) Define print_s_parts in HW1.py When print_s_parts(s) is run with the previously defined s, it should print: Tired Wired Inspired Hint: look at the endings of words. A small amount of positional indexing might be handy here. (e) Define print_s_change in HW1.py When print_s_change(s) is run with the previously defined s, it should print: Tired : Doing data science on your calculator. Wired : Doing data science in Python. Inspired : Training literal pythons to carry out machine learning using an abacus
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
