CM 3.5 Arguments MrG 2011.1024

3683 days ago by calcpage123

#1) def mystery(x,y): return x//y 
       
mystery(23,3) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}7
\newcommand{\Bold}[1]{\mathbf{#1}}7
mystery(3,23) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}0
\newcommand{\Bold}[1]{\mathbf{#1}}0
mystery(23,-3) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}-8
\newcommand{\Bold}[1]{\mathbf{#1}}-8
23//3 
       
\newcommand{\Bold}[1]{\mathbf{#1}}7
\newcommand{\Bold}[1]{\mathbf{#1}}7
23%3 
       
\newcommand{\Bold}[1]{\mathbf{#1}}2
\newcommand{\Bold}[1]{\mathbf{#1}}2
23//-3 
       
\newcommand{\Bold}[1]{\mathbf{#1}}-8
\newcommand{\Bold}[1]{\mathbf{#1}}-8
23%-3 
       
\newcommand{\Bold}[1]{\mathbf{#1}}-1
\newcommand{\Bold}[1]{\mathbf{#1}}-1
16//-5 
       
\newcommand{\Bold}[1]{\mathbf{#1}}-4
\newcommand{\Bold}[1]{\mathbf{#1}}-4
16%-5 
       
\newcommand{\Bold}[1]{\mathbf{#1}}-4
\newcommand{\Bold}[1]{\mathbf{#1}}-4
16//5 
       
\newcommand{\Bold}[1]{\mathbf{#1}}3
\newcommand{\Bold}[1]{\mathbf{#1}}3
16%5 
       
\newcommand{\Bold}[1]{\mathbf{#1}}1
\newcommand{\Bold}[1]{\mathbf{#1}}1
#2) def mystery2(x,y): return x/y 
       
mystery2(23,-3).n() 
       
\newcommand{\Bold}[1]{\mathbf{#1}}-7.66666666666667
\newcommand{\Bold}[1]{\mathbf{#1}}-7.66666666666667
#3) def avg(a,b): return (a+b)/2 avg(2,5).n() 
       
\newcommand{\Bold}[1]{\mathbf{#1}}3.50000000000000
\newcommand{\Bold}[1]{\mathbf{#1}}3.50000000000000
#4) def swap(x,y): temp=x x=y y=temp a=2 b=7 swap(a,b) show(a) show(b) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}2
\newcommand{\Bold}[1]{\mathbf{#1}}7
\newcommand{\Bold}[1]{\mathbf{#1}}2
\newcommand{\Bold}[1]{\mathbf{#1}}7
#5) def swap2(pair): temp=pair[0]; pair[0]=pair[1]; pair[1]=temp l=[3,4] swap2(l) l 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[4, 3\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[4, 3\right]
#6) def swap3(pair): return [pair[1],pair[0]] l=[5,4] swap3(l) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[4, 5\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[4, 5\right]
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[5, 4\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[5, 4\right]
#7) def quadForm(a,b,c): d=b^2-4*a*c r1=(-b+sqrt(d))/2*a r2=(-b-sqrt(d))/2*a return [r1,r2] quadForm(1,2,2) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[i - 1, -i - 1\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[i - 1, -i - 1\right]