This drill will guide you through installing and using Python. We expect this will take a little more than half an hour.
Download Python by following these instructions.
For the next parts, we have a video for instructions at the bottom of the page.
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!
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!"
.
Use your function once or twice using the print
function. For example, print(greeting("Heila"))
will print out “Hi Heila” on the terminal.
Submit your file to the Google Form.
This is for once you have PyCharm Edu installed.