Use of procedures, parameter passing, block structures, data types, arrays, abstract data structures, conditional control, iterative and recursive processes, and input/output in programming solutions to a variety of problems. Prerequisite: None.

Lab 1 - Getting started with Python - (50 points)



Due date: 2/6/2019 at 11:59pm

Objectives



  • Familiarize yourself with the Python syntax
  • Learn about variables
  • Familiarize yourself with basic command line operation and submission

Product of the first five positive integers (5 points)



Write a Python program (product.py) that prints the result of multipling the first five positive integers starting at 1.

Practice with print (15 points)



Write a program (house.py) that prints a house that looks exactly like the following
      +
     + +
    +   +
   +-----+
   | .-. |
   | | | |
   +-+-+-+ 

Practice with Integers (30 points)



Write a program (integeroperations.py) that prompts the user for two integers and then prints

  • The difference
  • The product
  • The average
  • The distance (absolute value of the difference) - Use the abs() function
  • The maximum (the larger of the two) - Use the max() function
  • The minimum (the smaller of the two) - Use the min() function

Submitting the lab using Canvas



Upload the following files to Canvas:

  1. product.py
  2. house.py
  3. integeroperations.py
  4. README file - A description of your lab with your name and your student ID. Please include any problems you faced, any resources you used, names of friends/tutors you received help from.