Lab 1: Basics of Python
This is the first lab in Python! Please read the question/task and input the answer and screenshots to a
word document. Please name the document Intro2Py and email this to the instructor’s email with the
Subject of: Lab1 – Your_Name.
Basic Python Info:
1. How do you check the version of Python in Linux? (Provide an example w/Screenshots)
2. What is the name of the process of inputting a value to a variable?
3. When is a good time to use the Interactive Shell?
4. What was the first program we wrote in Python?
Python Syntax:
5. How do you escape the string to a new line? (Give an example w/Screenshots):
6. What does the print function do in Python?
7. When using the Print Function what is used inside the parenthesis? (Give an example
w/Screenshots):
8. What is an example of good naming convention?
9. In Python create the following Variable w/ their appropriate values and describe the differences:
a. Apple = 10;
b. apple = ‘20’;
10. In Python please use #9 and combine them into one print function. (Provide Examples
w/Screenshots)
Python Hands-on
11. In Python, create a program that outputs the following variables w/ the appropriate values.
(Please in a comment above the variable the data type it is using):
a. Name:
b. Grade:
c. Age:
d. Month of Birth:
e. Favorite Number:
12. Using the Midpoint formula, please recreate the formula in Python with the following inputs
(Provide Examples w/Screenshots):
a. A = (2,4) B = (-4,-4)
b. A = (4,3) B = (3,-4)
c. A = (-4,2) B = (2,-2)
d. A = (-3,-5) B = (3,5)
13. Now change all the user’s input from #12 into int and print them out. . (Provide Examples
w/Screenshots)
14. Utilize the program for #12 and create user’s input for each X and Y coordinates. (Provide
Examples w/Screenshots)
15. In Python create a basic loop that counts down from 10 to 0. (The out need to include 10 and 0)
(Provide code w/Screenshots of output):