198
edits
Changes
→PART 1 - INPUT
= INVESTIGATION 1: USER INPUT =
== PART 1 - USER INPUT ==This first part will cover how to ask the user running the program for input or more informationdata. Though we will not be doing very much with the information we provide provided currently, in later labs sections this will become a key part of how you change the way a program works.
=== Storing User Input In Variables === :'''lab2aPerform the following steps:'''
:#First lets start out with a very basic script. This script will use variables to print out specific information to the screen. Make the script '''lab2a.py''' with the following content.<source>
#!/usr/bin/env python3
</source>
:#Before proceeding, make certain that you identify any and all errors in "lab2a.py". When the check script tells you everything is "ok", you may procede to the next step.
:#Now it's time to create a new script. Make a copy of '''lab2a.py''' and call it '''lab2b.py'''. Now modify '''lab2b.py''' so that it asks the user for both the value of name and the value of age. Use the input() function and store the values in the correct variables. Example output is shown below:
Sample run 1: