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

Hi, please need help for python lab, use 3.4.2 shell Overview The children\'s so

ID: 639980 • Letter: H

Question

Hi, please need help for python lab, use 3.4.2 shell

Overview

The children's song that we'll work on is "There was an Old Lady". In case you aren't familiar with it, here are the lyrics:

There was an Old Lady

There was an old lady who swallowed a fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

There was an old lady who swallowed a spider,
That wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

There was an old lady who swallowed a bird.
How absurd to swallow a bird.
She swallowed the bird to catch the spider,
That wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

There was an old lady who swallowed a cat.
Imagine that to swallow a cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider,
That wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

There was an old lady who swallowed a dog.
My, what a hog, to swallow a dog.
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider,
That wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly.
Perhaps she'll die.

{insert your own verse here

Explanation / Answer

def verse1():
   print ("I don't know why she swallowed the fly.")
   print("Perhaps she'll die.")
      
def verse2():
   print("That wriggled and jiggled and tickled inside her.")
   print ("She swallowed the spider to catch the fly.")
   verse1()
  
def verse3():
   print("She swallowed the cat to catch the bird.")
   verse2()

def verse4():
   print ("She swallowed the dog to catch the cat.")

def lastverse():
   print ("She swallowed the horse to catch the dog.")
  
def main():
   print ("There was an old lady who swallowed a fly.")
   verse1()
   print()
   print ("There was an old lady who swallowed a spider,")
   verse2()
   print()
   print ("There was an old lady who swallowed a bird.")
   print ("How absurd to swallow a bird.")
   verse3()
   print()
   print ("There was an old lady who swallowed a dog.")
   print ("My, what a hog, to swallow a dog.")
   verse4()
   print()
   print("There was an old lady who swallowed a horse.");
   print("She's dead, of course.")
   lastverse()
  
  
  
main()

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