Contents

  1. arith_and_assign.py
  2. average2.py

arith_and_assign.py 1/2

[
top][prev][next]
# Demonstrates arithmetic operations and assignment statements
# by Sara Sprenkle

x = 3
y = 5

print("x =", x)
print("y =", y)

#print("x*y =", x*y)

# alternatively:
result = x * y
print("x*y =", result)

average2.py 2/2

[
top][prev][next]
# Finds the average of two numbers
# IN PROGRESS
# by CS111 class

# assign two variables
num1=7
num2=2

# sum those two variables
mySum = num1 + num2

# divide those variables by two
myAverage = mySum/2

# display the output
print("The average is", myAverage)

Generated by GNU Enscript 1.6.6.