notebook.community
Edit and run
Python provides by default:
+ Addition - Subtraction * Multiplication / Division ** Exponentiation abs(x) Absolute value of x % Remainder of a/b // Integer part of a/b
Use Python as a simple calculator. Try the previous operations on different numbers (integers, floats, …).
Define an array a = [1, 2, 3] What is the result of 2a[2] ? What is the result of 2a ?
Combine operations and data types and comment your findings.
In [1]: a = [1,2,3] print(2*a[2]) print(2*a)
a = [1,2,3] print(2*a[2]) print(2*a)
6 [1, 2, 3, 1, 2, 3]
Without additional libraries, Python is almost useless for scientific computing.
Go to the introduction to Numpy.
In [ ]: