Tuesday, 24 May 2011

Exercises Part 2

Going back to your files from Exercises Part 1, we are going to be modifying them to allow user input.



  • Modify the first program to allow the user to enter a width and height. The area should be displayed on the screen as: The area is: x
  • Modify the second program to allow the user to enter a length. The result should be displayed on the screen as: The length is: x
  • Write a program to generate a random number between 1-10 and display the number on the screen as: Random number is: x
  • Once done with the above program, modify it to ask the user to guess the number, and display their guess on the screen.
  • *REMEMBER* You need to import the appropriate libraries when needed.
You can view the above random guessing program below. It is best to try it yourself first, and use this to check your code.



Once you have completed the above exercises you are ready to move on to the next lesson: Comparison and Boolean Operators

-Nathan (everythingPython)

No comments:

Post a Comment