Modify examples to be both Python 2 and 3 compatible

For removing dependency on 2to3
This commit is contained in:
William S Fulton 2020-08-15 16:46:01 +01:00
commit 89bee6a7fa
37 changed files with 368 additions and 388 deletions

View file

@ -7,15 +7,15 @@ import example
x = 42
y = 105
g = example.gcd(x, y)
print "The gcd of %d and %d is %d" % (x, y, g)
print("The gcd of %d and %d is %d" % (x, y, g))
# Manipulate the Foo global variable
# Output its current value
print "Foo = ", example.cvar.Foo
print("Foo = %s" % example.cvar.Foo)
# Change its value
example.cvar.Foo = 3.1415926
# See if the change took effect
print "Foo = ", example.cvar.Foo
print("Foo = %s" % example.cvar.Foo)