CompSciHW1

Homework 1 (due Monday, Jan. 25, 2016)

Use the 7 forms to write code performing the following:


 * 1) Create a variable named x holding the string "Hello World!"
 * 2) Create a (length 8) list containing the pattern below:
 * 3) * 3 8 15 24 35 48 63 80
 * 4) * Each element should use an arithmetic expression (calculator form).
 * 5) * assign the list to the variable y
 * 6) Print a greeting displaying the variable x followed by element 4 of the list above.
 * 7) Assign the variable z to element 4 of y if element 4 of y is larger than 42.  Otherwise, set z equal to element 5 of y.
 * 8) Call the function x.__add__ with one argument, " World! World!".
 * 9) Re-write your answer to the last question by sending a variable as an argument, instead of directly writing "World! World!".
 * 10) Write a description of what the following program does.
 * 11) * How would you modify the code to eliminate all the i = len(x)-1 lines?
 * 12) * Re-write the code, abstracting out the numbers 61 and 900 into variables a and m.