1) abs() Return the absolute value of a number
len() Return
2) the
length of an object
.
3) max() Find the value in a list or similar
largest object .
4) min() Find the smallest value in a list or similar object.
5) print( Print the value of an
object.
6) round (X , n) Round a number X +on decimal places
7) Sum)) Sum the values in a list or similar.
Data
type
:
*
Integer - int)
float)) decimal
*
Floating point number numbers
>
List< list) element
*
eg
2, 4
,
6 ordered collection of items.
XLy : 2 from
ay
element to a z-c
* Boolean - bool)) is an
object that is either true or false.
*
String < str(l sequences of characters
Range :
>
-
H
1) (start stopl (2 10)
range ,
eg range ,
2-9
step) /2 10 2)
2)
range(start
2 4 6 8
stop
eg rang
, ,
.
, , , ,
Numpy :
import asnp
numpy .
for functions
trigonometric
in
Python you need numpy
·
np .
cos(np pi) . .
·
up. array > to convert an
existing list to an
array x[ Secondroustorsecond column
93)
egX np array (23 6
= .
, ,
print (x(3) + [1 ,
2 ,
3)
numbers
arrange sequences of
·
up .
Control flow and functions :
· for loop : repeat commands a number of times
if run commands
only if a condition is satisfied
· :
· while : run commands
only while a condition is satisfied
· def : creating a new function