Contents

  1. arith_and_assign2.py
  2. arith_and_assign.py

arith_and_assign2.py 1/2

[
top][prev][next]
# Demonstrates arithmetic operations and assignment statements.
# This program has one less assignment statement but the last print statement
# is more complicated, which, as our programs grow, makes it harder to debug programs.
# This works but is not the way we will typically write programs.
# by Sara Sprenkle

x = 3
y = 5

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

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

arith_and_assign.py 2/2

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

x = 3
y = 5

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

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

Generated by GNU Enscript 1.6.6.