0% found this document useful (0 votes)
6 views8 pages

Python

The document provides a lesson on printing personal information, performing calculations with numbers, and using Python lists and functions. It also introduces the NumPy library for array manipulation, including creating arrays, summation, and checking dimensions. Various list methods and their functionalities are discussed, along with examples of using NumPy for array operations.

Uploaded by

rachaie
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views8 pages

Python

The document provides a lesson on printing personal information, performing calculations with numbers, and using Python lists and functions. It also introduces the NumPy library for array manipulation, including creating arrays, summation, and checking dimensions. Various list methods and their functionalities are discussed, along with examples of using NumPy for array operations.

Uploaded by

rachaie
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

in this lession we can print your information with name

and your age and result will be :

For use calculation two number not oshary we need to


write this in visual code :

Result will be :

With number oshery :

And result will be :


Python list we can display lists with :

Lists 2 :

We can use too codzilla += tutorial the same result


+= is like
x=x+extension .extend( )
.append(" ")
.insert(ind_no, " " )
.remove(" ")
.clear()
.pop() > removes last item & can be saved as a var
.index(" ")
.count(" ")
.sort() > alphabetic sorting
.copy() > shallow copy = changes on the old list doesn't affect it
Function :

Resutl :
cube :

summation :

Substract :
Condition
Condition with calculation

Library numpy :
Getting start :
import numpy as np
x = [Link] ([1,10,15,30,55])
print (x)
resultat will be :

Summatio on numpy :
import numpy as np
x = [Link] ([1,10,15,30,55])
print (x[2]+x[3])
resultat will be :

Check Number of Dimensions


import numpy as np
a = [Link](42)
b = [Link]([1, 2, 3, 4, 5])
c = [Link]([[1, 2, 3], [4, 5, 6]])
d = [Link]([[[1, 2, 3], [4, 5, 6]], [[1, 2, 3], [4, 5, 6]]])
print([Link])
print([Link])
print([Link])
print([Link])
resultat will be :
Numpy array filter :

You might also like