Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help by using python or a linuix terminal. Completely unsure on how to do

ID: 3814343 • Letter: P

Question

Please help by using python or a linuix terminal. Completely unsure on how to do this. Thanks so much.

Exercise 1

Write a function named ‘what_does_the_fox_say()’, when you run it, it should produce following lyric fragments:

Ring-ding-ding-ding-dingeringeding!

Gering-ding-ding-ding-dingeringeding!

Gering-ding-ding-ding-dingeringeding!

Exercise 2

Use three ways to execute your program (what_does_the_fox_say.py) and watch the output

1, directly run it in Python

1, use from … import … functionality

3, use import functionality with Python interpreter

Explanation / Answer

Excercise1:

Create a file named foxSing.py (pastebin link: https://pastebin.com/2T8Qs0eR)

def what_does_the_fox_say():
print("Ring-ding-ding-ding-dingeringeding!")
print("Gering-ding-ding-ding-dingeringeding!")
print("Gering-ding-ding-ding-dingeringeding!")

if __name__ == "__main__":
what_does_the_fox_say()

Excercise 2:

1. directly run it in Python

$ python foxSing.py
Ring-ding-ding-ding-dingeringeding!
Gering-ding-ding-ding-dingeringeding!
Gering-ding-ding-ding-dingeringeding!

2. use from … import … functionality

$ python

Python 2.7.11 (default, Apr 25 2016, 09:27:56)
[GCC 5.2.1 20150902 (Red Hat 5.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from foxSing import what_does_the_fox_say
>>> what_does_the_fox_say()
Ring-ding-ding-ding-dingeringeding!
Gering-ding-ding-ding-dingeringeding!
Gering-ding-ding-ding-dingeringeding!

3, use import functionality with Python interpreter

$ python

Python 2.7.11 (default, Apr 25 2016, 09:27:56)
[GCC 5.2.1 20150902 (Red Hat 5.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import foxSing
>>> foxSing.what_does_the_fox_say()
Ring-ding-ding-ding-dingeringeding!
Gering-ding-ding-ding-dingeringeding!
Gering-ding-ding-ding-dingeringeding!

Please rate positively if this solved your question.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote