Saturday, March 8, 2014

Weekly Reflection #5

This week I didn't really have time to mess around with my hobby but in this chapter I started to learn how to make a program that tells jokes using the print() and input() function. In my book this section was probably one of the shorter chapters. The syntax set up like so; 
  1. print('What do you get when you cross a snowman with a vampire?') #box pops up with joke
  2. input() #play has to hit enter
  3. print('Frostbite!') //after input (enter) is given the joke is told
  4. print() #he third print() function call is just for the sake of spacing
Here we have three print() function calls because we don't want to tell the player what the joke's punch line is, we have a call to the input() function after the first print(). The player can read the first line, press Enter, and then read the punch line.I only got about that far in this chapter due to family related issues.

I took what I learned in the last chapter then applied it here.


No comments:

Post a Comment