CoCalc Public Files2021-02-17-han zhang .ipynbOpen with one click!
Authors: Marielys Bueno, Dylan Cortes, Zhang Han, Sharalee Jones , Wadud Khan, C Y, yang chen, sophie j
Views : 37
Compute Environment: Ubuntu 20.04 (Default)
In [1]:
5+8
13
In [2]:
98**2
--------------------------------------------------------------------------- KeyboardInterrupt Traceback (most recent call last) <ipython-input-2-740e56722452> in <module> ----> 1 7867899**646335 /usr/local/lib/python3.8/dist-packages/IPython/core/displayhook.py in __call__(self, result) 260 self.start_displayhook() 261 self.write_output_prompt() --> 262 format_dict, md_dict = self.compute_format_data(result) 263 self.update_user_ns(result) 264 self.fill_exec_result(result) /usr/local/lib/python3.8/dist-packages/IPython/core/displayhook.py in compute_format_data(self, result) 149 150 """ --> 151 return self.shell.display_formatter.format(result) 152 153 # This can be set to True by the write_output_prompt method in a subclass /usr/local/lib/python3.8/dist-packages/IPython/core/formatters.py in format(self, obj, include, exclude) 178 md = None 179 try: --> 180 data = formatter(obj) 181 except: 182 # FIXME: log the exception <decorator-gen-10> in __call__(self, obj) /usr/local/lib/python3.8/dist-packages/IPython/core/formatters.py in catch_format_error(method, self, *args, **kwargs) 222 """show traceback on failed format call""" 223 try: --> 224 r = method(self, *args, **kwargs) 225 except NotImplementedError: 226 # don't warn on NotImplementedErrors /usr/local/lib/python3.8/dist-packages/IPython/core/formatters.py in __call__(self, obj) 700 type_pprinters=self.type_printers, 701 deferred_pprinters=self.deferred_printers) --> 702 printer.pretty(obj) 703 printer.flush() 704 return stream.getvalue() /usr/local/lib/python3.8/dist-packages/IPython/lib/pretty.py in pretty(self, obj) 380 if cls in self.type_pprinters: 381 # printer registered in self.type_pprinters --> 382 return self.type_pprinters[cls](obj, self, cycle) 383 else: 384 # deferred printer /usr/local/lib/python3.8/dist-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle) 687 """A pprint that just redirects to the normal repr function.""" 688 # Find newlines and replace them with p.break_() --> 689 output = repr(obj) 690 for idx,output_line in enumerate(output.splitlines()): 691 if idx: KeyboardInterrupt:
In [3]:
98**2
9604
In [5]:
0.1+0.2
0.30000000000000004
In [7]:
def quantratic(x): ax^2+bx+c=0 return x
File "<ipython-input-7-637c6d89d61c>", line 2 ax^2+bx+c=0 ^ SyntaxError: cannot assign to operator
In [4]:
def linear(x): x=-d/m return x;
In [5]:
5 , 8
(5, 8)
In [1]:
linear(5,8)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-1-1529fbc018ba> in <module> ----> 1 linear(5,8) NameError: name 'linear' is not defined
In [ ]:
p180=p120*