Lab #1: Python Syntax
Lab #1: Python Syntax
For this lab, you are going to complete a few exercises that will help you practice with Python syntax. You’ll complete each of these exercises in the same program.
Step 1: Create a syntaxLab.py program in your unit2 folder.
Step 2: Complete the following exercises:
Exercise 1:
Write code to match the following terminal output:
Enter your name: Mike (the name you see is user input)
Hello, Mike (what the computer responds with)
Enter an integer: 10 (the number you see is user input)
Your number x doubled is y.(The x represents the user’s input - your program should do the math!)
The next number after a is b.(The a represents the user’s input - your program should do the math!)
Exercise 2:
Write a program that will output the following, exactly as you see it formatted.
The itsy bitsy spider crawled up the water spout.
Down came the rain, and washed the spider out.
Out came the sun, and dried up all the rain,
and the itsy bitsy spider went up the spout again.
Exercise 3:
Write a program that will ask a user what their favorite holiday is, and output to the terminal the following message:
Hello, xxxx!
Your favorite holiday is: xxxxxxxxxxx!
Remember, part of being a good programmer is commenting your code and formatting your output neatly, for all of these exercises!
To submit your work, please do the following:
- In the document on Schoology, copy and paste the URL for your program.
- Underneath the URL, you will also need to copy and paste your code.
- Underneath your code, you need to provide a screenshot of what your output looks like in your terminal.