Modify examples to be both Python 2 and 3 compatible
For removing dependency on 2to3
This commit is contained in:
parent
2af35cb4ff
commit
89bee6a7fa
37 changed files with 368 additions and 388 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue