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

  • View
    15.716

  • Download
    3

Embed Size (px)

Transcript

  • , , Python Python, 4, 2015

  • if N>0:print 'N is greater then 0'else: print 'N is not greater then 0'...

  • if N>0:print 'N is greater then 0'...

  • ax2 + bx + c = 0D > 0 2 D = 0 1 D < 0

  • :ab

    :a>0 and b>0 a>0 or b>0 not(a>0)

  • '

    ABA and BFalseFalseFalseFalseTrueFalseTrueFalseFalseTrueTrueTrue

    ABA or BFalseFalseFalseFalseTrueTrueTrueFalseTrueTrueTrueTrue

    Anot A FalseTrueTrueFalse

  • Python

    : Int Float Str

    Bool

    : -10, 0, 25 : -10.0, 0.0, 25.0: 'Hello!', 'Python'

    True

    False

  • Python

    : Int Float Str

    Bool

    : -10, 0, 25 : -10.0, 0.0, 25.0: 'Hello!', 'Python'

    True

    False: List : [-10, 0.1, 5, 'last']0 1 2 3

  • while ...N = float(text_prompt(' N:'))while N < 0: print('N \'') N = float(text_prompt(' N:'))...

  • , , ,

  • else: if ... elif ...

  • while ,

  • - for while, . while for

  • ! :

    "", 2015