Prometheus. Масовий онлайн курс "Основи програмування". Лекція 6

  • View
    6.384

  • Download
    3

Embed Size (px)

Transcript

  • ! Python Python, 6, 2015

  • PythonInt -10, 0, 25Float -10.0, 0.0, 25.0

  • PythonInt -10, 0, 25Float -10.0, 0.0, 25.0}32 =4 = 4 294 967 296 -2 147 483 647 ... 0 ... 2 147 483 647232 2014 => 111 11011110 => 210 + 29 + 28 + 27 + 26 + 24 + 23 + 22 + 210 0 0 0 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 1 1 11 1 0 1 1 1 1 02014

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.0}32 =4 1 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 11 1 1 1 1 1 1 1 _2 147 483 647+ 1= 2 147 483 648= 0 ( -2 147 483 648)? , Python Long, " "

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.01234.5 = 1.2345 1031234.5 = 1.20556640625 210Floating point< 21 1023-1022 ()

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.01234.5 = 1.2345 1031234.5 = 1.20556640625 210< 21 1023-1022 1/8 = 0.125= 1.25 10-1= 1.0 2-31/10 = 0.1= 1.0 10-1= 1.999999... 2-1 ,

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.0Bool True, Falsesing('lalala') and go()needStop or (a>0 and b>0)not looser and (money> 100)date == 13 or day=='friday'a>0 and b>0piece = not war0, 0.0, "", None, [] False 0, "False" FalseTrue True 1, "True"

    ABA and BFFFFTFTFFTTT

    ABA or BFFFFTTTFTTTT

    Anot A FTTF

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.0Str 'Hi!', "Python"Bool True, False'Yesterday,'"All my troubles seemed so far away""Now it looks as though they're here to stay"'Oh, I believe in "yesterday"'"""Suddenly,I'm not half the man I used to be"""* ;-)*

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.0Str* 'Hi!', "Python"Bool True, False* ;-)a a = 1a = a + 112a ( , )

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.0Str* 'Hi!', "Python"Bool True, FalseList [1, 2.0, 'three']List [1, 2.0, 'three']

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.0Bool True, FalseStr* 'Hi!', "Python"List [1, 2.0, 'three']Tuple (1, 2.0, 'three') , list,

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.0Str* 'Hi!', "Python"Bool True, FalseList [1, 2.0, 'three']Tuple (1, 2.0, 'three')Dict {1:'one', 2:'two'} Dict "DICTIONARY"! " - "

  • PythonInt, Long -10, 0, 25Float -10.0, 0.0, 25.0Str* 'Hi!', "Python"Bool True, FalseList [1, 2.0, 'three']Tuple (1, 2.0, 'three')Dict {1:'one', 2:'two'}Object' * ;-)

  • ! :

    "", 2015