Skip to content

lis875/control-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello

Prints out the word Hello. To run this program, use

python hello.py

Which should produce:

Hello!

Mad Libs

To run this program, use

python mad-libs.py

And it should output:

Rocket Raccoon: His people are entirely literal. Metaphors go right over his head
Drax the Destroyer: Nothing goes over my head . My reflexes are excellent and I would catch it.

Star-Lord: Oh will you shut up about that? God, 20 years you've been throwing that in my face. Like it's some great thing, "not eating me". Normal people don't even think about eating someone else, much less, that person having to be grateful for it.

Mad Libs, with user input

To run this program, use

python mad-libs-input.py

Here is some example output:

Name of a place: Ann Arbor
An action that someone an do: sleep
Another action: jump
Thing that makes noise: whoopie cushion
Something that you can buy: shoes
How tall are you? six foot
Something you an hold in your hands: phone


Do you come from Ann Arbor?
Where women sleep and men jump?
Can't you hear, can't you hear the whoopie cushion?
You better run, you better take cover

Buying shoes from a man in Brussels
He was six foot and full of muscles
I said, "do you speak-a my language?"
He just smiled and gave me a phone

Avengers

Avengers is a very simple choose-your-story program. To run it,

python avengers.py

Here is sample output:

Thor, Iron Man, and Captain America are all sitting around a room.  The other Avengers are also somewhere nearby.
As they are talking, Iron Man says 'Thor, I bet I can lift your hammer!'
'I'd like to see you try!' Thor responds
Captain America looks skeptical.  'Its not a good idea to mess with Thor's hammer' he says

Who will first try to pick up Thor's hammer? Thor
Thor walks over to the hammer and reaches down to pick it up.
'Of course, it is as light as paper for me' he brags.  'I am righteous; I can always pick it up'

Does Thor pick up the hammer? No
'I am a God.  I don't need to prove anything' says Thor.
Iron man looks down at him. 'You can't lift it.  I knew it!' he says.
Captain America walks over to the hammer, picks it up, and throws it to Thor.
'Yup, really is light as a feather' he says.

Releases

No releases published

Packages

No packages published

Languages