nbtutorial

155 days ago by arsal.ahmed123@gmail.com

 
       
 
       
 
       
 
       
 
       
 
       
 
       
 
       
 
       
 
       
2 + 2 57.1 ^ 100 
       
4.60904368661396e175
4.60904368661396e175
%python a = 1 type(a) 
       
<type 'int'>
<type 'int'>
%java System.out.print("Hello"); 
       
Traceback (click to the left of this block for traceback)
...
NameError: name 'java' is not defined
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_8.py", line 10, in <module>
    exec compile(u'print _support_.syseval(java, u\'System.out.print("Hello");\', __SAGE_TMP_DIR__)
  File "", line 1, in <module>
    
NameError: name 'java' is not defined
sin(60) 
       
sin(60)
sin(60)
%javascript alert("Hello") 
       
Traceback (click to the left of this block for traceback)
...
NameError: name 'javascript' is not defined
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_9.py", line 10, in <module>
    exec compile(u'print _support_.syseval(javascript, u\'alert("Hello")\', __SAGE_TMP_DIR__)
  File "", line 1, in <module>
    
NameError: name 'javascript' is not defined
var('a') sin(a) 
       
sin(a)
sin(a)
sin(pi/2) n(sin(pi/4)) 
       
0.707106781186548
0.707106781186548
var('x') function('f',x) f(x) = x^2 - 5*x + 6 find_root(f(x)==0,1,10) 
       
2.9999999999999472
2.9999999999999472
diff(sin(x),x) integral(x**2 
       
Traceback (click to the left of this block for traceback)
...
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_19.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZGlmZihzaW4oeCkseCkKaW50ZWdyYWwoeCoqMg=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpiETOFL/___code___.py", line 5
    
                              ^
SyntaxError: invalid syntax
@interact def s_plot(n = 1): t = var('t') p = plot(e^-(n*t) * sin(2*t),(t,0,15)) show(p) 
       

Click to the left again to hide and once more to show the dynamic interactive window

@interact def sine_plot(n = 1): x = var('x') p2 = plot(sin(n*x),(x,0,2*pi)) show(p2) 
       

Click to the left again to hide and once more to show the dynamic interactive window