python3
>>> def cheer_1(team): ... print("Go " + team + "!") ...
cheer_1("Red Sox")
def cheer_2(): ... print("Go " + team + "!") ...
>>> team = "Patriots" >>> cheer_2()
def cheer_3(team, times=3): ... for i in range(times): ... print("Go " + team + "!") ...
>>> cheer_3("Red Sox", 5) >>> cheer_3("Red Sox", 1) cheer_3("Red Sox")
Go Patriots! Go Patriots! Go Red Sox! Go Red Sox! Go Red Sox! Go Bruins! 1 squared is 1 2 squared is 4 3 squared is 9 4 squared is 16 5 squared is 25 1 cubed is 1 2 cubed is 8 3 cubed is 27 4 cubed is 64 5 cubed is 125 1 multiplied by itself 2 times is 1 2 multiplied by itself 2 times is 4 3 multiplied by itself 2 times is 9 4 multiplied by itself 2 times is 16 5 multiplied by itself 2 times is 25
cd it116
cd ex
mkdir ex12
ls
cd it116/ex/ex12
python3 ex12.py
Go Patriots! Go Patriots! Go Red Sox! Go Red Sox! Go Red Sox! Go Bruins! 1 squared is 1 2 squared is 4 3 squared is 9 4 squared is 16 5 squared is 25 1 cubed is 1 2 cubed is 8 3 cubed is 27 4 cubed is 64 5 cubed is 125 1 multiplied by itself 2 times is 1 2 multiplied by itself 2 times is 4 3 multiplied by itself 2 times is 9 4 multiplied by itself 2 times is 16 5 multiplied by itself 2 times is 25
~ghoffman/it116_test/ex12.shThe script will prompt you for your Unix username.