Drill 14

This drill will guide you through installing and using Python. We expect this will take a little more than half an hour.

  1. Download Python by following these instructions.

    For the next parts, we have a video for instructions at the bottom of the page.

  2. Make a new Python file called drill14.py.

    Copy the following code into the file:

    from dataclasses import dataclass def greeting(name : str) -> str: return "Hi " + name

    Here are some errors you might get when running this. If you get an error that looks like either of these, you’ve installed the wrong version of Python. Let the TAs know!



  3. Write a function called say_goodbye that takes in a name and outputs a greeting to the input name. For example, say_goodbye("Eli") returns "Bye Eli!".

  4. Use your function once or twice using the print function. For example, print(greeting("Heila")) will print out “Hi Heila” on the terminal.

  5. Submit your file to the Google Form.

Instructions Video

This is for once you have PyCharm Edu installed.