CS 115 Lab 1, Part C: Modifying Your Python Program

[Back to Lab 1]


Instructions

  1. In PyCharm, modify your program so that it looks like this. Make sure your name is in the docstring.
    """
    Lab 1: This program prompts for your name and then greets you by name.
    Author: ____________
    """
    
    
    def main():
        name = input('What is your name? ')
        print('Hi there, ', name, '.', sep="")
    
    
    main()
    
  2. Run your program again. What does sep do?
  3. Modify the program so that it asks you for your favorite movie and then tells you that your taste is terrible. Here is an example of what your program should do. In this example, the user's input is underlined and italicized, and the rest of the text should be printed by your program:
    What is your favorite movie? Transformers
    Ugh, Transformers is a terrible movie.
  4. Here is another example. In this example, the user's input is Mission Impossible.
    What is your favorite movie? Mission Impossible
    Ugh, Mission Impossible is a terrible movie.
  5. Change the first line of the docstring so that it accurately describes what the program does now.
  6. When your program's behavior matches the samples exactly, flag down the instructor or student assistant to demo your program. This demo is part of your lab grade, so don't skip it! You can redo the demo as many times as necessary until you get it perfect.
  7. Once you have done the demo and are happy with your program, answer Question 7 in Moodle.
  8. Now continue to Part D.