set list tuple set set() Sets methods .intersection() - - PowerPoint PPT Presentation

set
SMART_READER_LITE
LIVE PREVIEW

set list tuple set set() Sets methods .intersection() - - PowerPoint PPT Presentation

set list tuple set set() Sets methods .intersection() .union() .difference() set sets methods .add() .update() .remove() .discard() list comprehension lists generators generator list next() list list list list 1 - 1 -


slide-1
SLIDE 1
slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4

set

slide-5
SLIDE 5

list tuple set

set()

slide-6
SLIDE 6

Sets methods .intersection() .union() .difference()

slide-7
SLIDE 7

set sets methods .add() .update() .remove() .discard()

slide-8
SLIDE 8

list comprehension lists

slide-9
SLIDE 9

generators generator list next()

slide-10
SLIDE 10

list list

slide-11
SLIDE 11

list list

slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14

1

slide-15
SLIDE 15

1

slide-16
SLIDE 16
slide-17
SLIDE 17

class class attributes Class methods class

  • 1. Created a class in a saved script;
  • 2. Launched the script in the shell;
slide-18
SLIDE 18

class class attributes Class methods class

I can access attributes of my class by using the proper syntax.

slide-19
SLIDE 19

attributes

slide-20
SLIDE 20

function class

slide-21
SLIDE 21
slide-22
SLIDE 22

class self.year None

slide-23
SLIDE 23

__str__ special function

slide-24
SLIDE 24

__str__ special function

slide-25
SLIDE 25

special function __dict__

slide-26
SLIDE 26

special functions

  • bject.__str__(self)
  • bject.__dict__(self)
  • bject.__del__(self)
  • bject.__hash__(self)
  • bject.__repr__(self)
  • bject.__bytes__(self)
  • bject.__format__(self)

special functions

slide-27
SLIDE 27
slide-28
SLIDE 28

exceptions

slide-29
SLIDE 29
slide-30
SLIDE 30

handle exception try-except

slide-31
SLIDE 31

handle exceptions

slide-32
SLIDE 32
slide-33
SLIDE 33

Lambdas functions anonymous functions Lambdas function lambda function

slide-34
SLIDE 34

Lambdas attributes functions

slide-35
SLIDE 35
slide-36
SLIDE 36

Map function list

slide-37
SLIDE 37

lists list

slide-38
SLIDE 38

lists list list

sum len

slide-39
SLIDE 39

lists list list

sum len

list comprehension

slide-40
SLIDE 40

for map

sum len

slide-41
SLIDE 41

for list comprehension map

  • for while
  • As little as possible
slide-42
SLIDE 42

Filter function filter function numbers_list lambda function module operator x%2

slide-43
SLIDE 43

filter list strings

slide-44
SLIDE 44
slide-45
SLIDE 45

Python Python Anaconda

Python

libraries pip tcl/tk

  • ther
slide-46
SLIDE 46

libraries pip tcl/tk

  • ther

> pip --version > pip 18.1 > pip install matplotlib > # to install something > py -2 –m pip install matplotlib > # …selecting the right version of Py > pip install --upgrade matplotlib > # to install and upgrade something

slide-47
SLIDE 47

libraries pip tcl/tk

  • ther

pip tcl/tk

slide-48
SLIDE 48

pip tcl/tk

slide-49
SLIDE 49

Python Python

slide-50
SLIDE 50

$ virtualenv –p /usr/bin/python3.6 «my_project» $ source ‘path/to/env/bin/activate’ (my_project) user@localhost:~$

… do things in the environment…

(my_project) user@localhost:~$ deactivate $ > virtualenv –p /usr/bin/python3.6 «my_project» > ‘path/to/env/Script/activate’ (my_project) C://path/to/env >

… do things in the environment…

(my_project) C://path/to/env > deactivate >

py -3 -m venv «my_project»

slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53

… …

slide-54
SLIDE 54

Repository Working copy

slide-55
SLIDE 55
slide-56
SLIDE 56

Git

slide-57
SLIDE 57
slide-58
SLIDE 58

$ git config --global user.name "[my username]" $ git config --global user.email "[my email address]"

slide-59
SLIDE 59

$ git init # I initialized my folder as a local repository $ git clone git://github.com/link_to_project.git # I copy inside my local repository a perfect copy of the remote repository … hours of work on the code … $ git add . # my code is now in the staging area ready to be confirmed and committed into my local repository $ git commit -m ‘Added support to X functionality‘ # I committed my code to the local repository $ git push origin master # I uploaded the content of my local repository to the remote repository

slide-60
SLIDE 60

git init git clone [url] git add [file] git add . git commit –m "[message]" git push [alias] [branch] git pull

slide-61
SLIDE 61

61 61