Homework 2: Finding Your Way in R and Python
Download the starter qmd file here
MadLibs
Running a Python Script at the command line
Run the script madlibs.py using the terminal to run the script (e.g. type python3 madlibs.py
in the terminal). Do what it asks of you. Copy the text after the initial command and paste it between the markings below. (These
define a generic, no-language markdown code chunk).
# Paste your output here!
Can you run this same script in RStudio using the Source Script button? If you can, please describe any differences you note compared to using the terminal. If you cannot, tell me what happens.
Thinking Critically
Consider the counting words examples in the textbook (Your Turn – Terminal Mode, Your Turn – Script Mode). Look at the code, and then at the steps provided for each example. What is different? What is the same? Create a table comparing terminal mode, script mode (e.g. running the whole script using the Run button), and interactive mode. Address the specific differences in how the user interacts with the code, differences in any user inputs (if available) and how they’re specified, and any differences in the output.