Getting Started Lab
This is a lab assignment and so you will not be submitting it. However, the concepts and practice will help you on both the homework and exams so I encourage you to make a serious effort on it during class and consider finishing it outside of class.
Exercise 0
- Mount the COURSES drive
- Create a new folder in your STUWORK folder called
Lab1
- Open VSCode
- Click and drag you
Lab1
folder to the VSCode window to open it - Create a new file named
hello.py
- Drag up from the bottom of the VSCode screen to open a
Terminal
Exercise 1
You’ll now test out using Gradescope.
- Navigate to Moodle, today’s class section and click on the “In Class Assignment” Gradescope link
- Upload
hello.py
to Gradescope (yes, even though it’s empty) - Notice what the autograder does when your code doesn’t work correctly
- In
hello.py
type:print(“hello world!”)
- Don’t copy and paste! You should always type out Python code even if copying and pasting it is an option. Copying often introduces errors to the code because of weird spaces and it is good practice for you to start getting used to typing Python commands.
- Save
hello.py
- See what your program does by typing
python3 hello.py
in the VSCode Terminal (it should print out “hello world!” without the quotes) - Upload
hello.py
to Gradescope again and make sure that you pass the first test case - Add your partner to the submission on Gradescope:
Exercise 2
We’ll be doing a lot with getting input from the Terminal in these first few weeks and it’s a little annoying to make sure that the formatting is just right for this sort of thing, so you’ll now get some practice.
- Make another file
hello_input.py
- You can accept input from the user with the command
input
and save it to use later in a variable (we’ll learn more about exactly what variables andinput
do in the coming week). Type the following into your new file:new_name = input("What is your name?") print(new_name)
- Run your program by typing
python3 hello_input.py
in the Terminal. - Change your program so that it does the following when run:
python3 hello_input.py What is your name? Anya Hello, Anya!
- Upload both of your files to the Gradescope In Class Assignment to check if all the test cases are now passing.
Extra
If you finish everything above, work on the Runestone problems in Getting Started Lab Extra linked on Moodle.