CM 3.3 Variable Scope MrG 2011.1019

3690 days ago by calcpage123

#2) def f(x): return (sqrt(x)+1)/(sqrt(x)-1) f(3).n() 
       
\newcommand{\Bold}[1]{\mathbf{#1}}3.73205080756888
\newcommand{\Bold}[1]{\mathbf{#1}}3.73205080756888
def g(x): temp=sqrt(x) return (temp+1)/(temp-1) g(3).n() 
       
\newcommand{\Bold}[1]{\mathbf{#1}}3.73205080756888
\newcommand{\Bold}[1]{\mathbf{#1}}3.73205080756888
#3) def factorial(n): k=2 f=1 while k<=n: f*=k #f=f*k k+=1 #k=k+1 return f factorial(pi) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}6
\newcommand{\Bold}[1]{\mathbf{#1}}6
#4) k=10 def kTimes(x): return k*x kTimes(5) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}50
\newcommand{\Bold}[1]{\mathbf{#1}}50
#k=10 def kTimes2(x): k=5 return k*x kTimes2(5) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}25
\newcommand{\Bold}[1]{\mathbf{#1}}25