argument nuancescs1112/term/183/meetings/30/...program cautionary.py import tale city1 =...
TRANSCRIPT
![Page 1: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/1.jpg)
ARGUMENT NUANCES
![Page 2: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/2.jpg)
• In Python function invocations, copies of the values of arguments are used to initialize the parameters. This style of parameter passing is known as pass by value.
• Because copies are used, the values of the arguments cannot be modified within the function being invoked.
SETUP
![Page 3: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/3.jpg)
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
![Page 4: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/4.jpg)
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
main
city1
city2
’London'
'Paris'
![Page 5: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/5.jpg)
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
main
city1
city2
’London'
'Paris'
f()
rmbr
x
y
![Page 6: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/6.jpg)
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
main
city1
city2
’London'
'Paris'
f()
rmbr
x
y
![Page 7: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/7.jpg)
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
main
city1
city2
’London'
'Paris'
f()
rmbr
x
y
![Page 8: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/8.jpg)
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
main
city1
city2
’London'
'Paris'
f()
rmbr
x
y
![Page 9: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/9.jpg)
f()
rmbr
x
y
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
main
city1
city2
’London'
'Paris'
![Page 10: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/10.jpg)
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
main
city1
city2
’London'
'Paris'
f()
rmbr
x
y
![Page 11: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/11.jpg)
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
main
city1
city2
’London'
'Paris'
f()
rmbr
x
y
![Page 12: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/12.jpg)
Program cautionary.py
import tale
city1 = 'London'
city2 = 'Paris’
tale.f( city1, city2 )
print( city1, city2 )
PYTHON FILES
Module tale.py
def f( x, y ) :
rmbr = x
x = y
y = rmbr
main
city1
city2
’London'
'Paris'
f()
rmbr
x
y
main
city1
city2
![Page 13: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/13.jpg)
![Page 14: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/14.jpg)
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def zero( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
![Page 15: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/15.jpg)
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 3 1 4
![Page 16: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/16.jpg)
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 3 1 4
out()
x
i
n
![Page 17: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/17.jpg)
out()
x
i
n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 3 1 4
![Page 18: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/18.jpg)
out()
x
i
n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 3 1 4
![Page 19: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/19.jpg)
out()
x
i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 3 1 4
![Page 20: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/20.jpg)
out()
x
i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 3 1 4
![Page 21: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/21.jpg)
out()
x
0 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 3 1 4
![Page 22: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/22.jpg)
out()
x
0 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 3 1 4
![Page 23: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/23.jpg)
out()
x
0 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 1 4
![Page 24: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/24.jpg)
out()
x
0 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 1 4
![Page 25: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/25.jpg)
out()
x
1 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 1 4
![Page 26: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/26.jpg)
out()
x
1 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 1 4
![Page 27: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/27.jpg)
out()
x
1 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 0 4
![Page 28: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/28.jpg)
out()
x
1 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 0 4
![Page 29: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/29.jpg)
out()
x
2 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 0 4
![Page 30: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/30.jpg)
out()
x
2 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 0 4
![Page 31: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/31.jpg)
out()
x
2 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 0 0
![Page 32: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/32.jpg)
out()
x
2 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 0 0
![Page 33: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/33.jpg)
out()
x
2 i
3 n
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 0 0
main
nbrs
![Page 34: ARGUMENT NUANCEScs1112/term/183/meetings/30/...Program cautionary.py import tale city1 = 'London' city2 = 'Paris’ tale.f( city1, city2 ) print( city1, city2 ) PYTHON FILES Module](https://reader035.vdocuments.us/reader035/viewer/2022081407/604b7821e6430f328c0b55a8/html5/thumbnails/34.jpg)
Program wipe.py
import zero
nbrs = [ 3, 1, 4 ]
zero.out( nbrs )
print( nbrs )
PYTHON FILES
Module zero.py
def out( x) :
n = len( x )
for i in range( 0, n ) :
x[ i ] = 0
main
nbrs 0 0 0
main
nbrs