jagomart
digital resources
picture1_Python Pdf 182326 | 1000 Python Examples By Gabor Szabo


 115x       Filetype PDF       File size 2.15 MB       Source: 14.99.188.242ː8080


File: Python Pdf 182326 | 1000 Python Examples By Gabor Szabo
1000pythonexamples gabor szabo this book is for sale at http leanpub com python examples this version was published on 2020 05 28 this is a leanpub book leanpub empowers authors ...

icon picture PDF Filetype PDF | Posted on 31 Jan 2023 | 2 years ago
Partial capture of text on file.
       1000PythonExamples
       Gábor Szabó
       This book is for sale at http://leanpub.com/python-examples
       This version was published on 2020-05-28
       This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing
       process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and
       manyiterations to get reader feedback, pivot until you have the right book and build traction once
       youdo.
       ©2020GáborSzabó
                   Contents
                   First steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    1
                         WhatisPython? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           1
                         Whatisneededtowriteaprogram? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                    1
                         Thesource (code) of Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            2
                         Python 2 vs. Python 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         2
                         Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    2
                         Installation on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       3
                         Installation on Apple Mac OSX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             3
                         Installation on MS Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            3
                         Editors, IDEs     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4
                         Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         6
                         Program types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       6
                         Python on the command line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            6
                         First script - hello world . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      7
                         Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      7
                         Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        7
                         Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     8
                         Exercise: Hello world . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         8
                         Whatisprogramming? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              8
                         Whataretheprogramminglanguages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                    8
                         Awritten human language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             9
                         Aprogramminglanguage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              9
                         Wordsandpunctuation matter! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .               9
                         Literals, Value Types in Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           9
                         Floating point limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       10
                         Value Types in Numpy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          10
                         Rectangular (numerical operations) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          11
                         Multiply string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     11
                         Addnumbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        11
                         Addstrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      11
                         Exercise: Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      11
                         Solution: Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      12
                   Second steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      13
                    CONTENTS
                         Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         13
                         Amainfunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             13
                         Themainfunction - called . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              13
                         Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         14
                         Conditional main . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          14
                         Input - Output I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          15
                         print in Python 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         15
                         print in Python 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         16
                         print in Python 2 as if it was Python 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             17
                         Exception: SyntaxError: Missing parentheses in call . . . . . . . . . . . . . . . . . . . . . . . .                 17
                         Prompting for user input in Python 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              17
                         Prompting for user input in Python 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              18
                         Python2 input or raw_input? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             19
                         Prompting both Python 2 and Python 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                  19
                         Addnumbersenteredbytheuser(oups) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                      20
                         Addnumbersenteredbytheuser(fixed) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                       20
                         HowcanIcheckifastringcanbeconvertedtoanumber? . . . . . . . . . . . . . . . . . . .                                 21
                         Converting string to int . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          21
                         Converting float to int . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         22
                         Conditionals: if . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        23
                         Conditionals: if - else      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    23
                         Conditionals: if - else (other example) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             24
                         Conditionals: else if . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         24
                         Conditionals: elif . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        25
                         Ternary operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          25
                         Case or Switch in Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            26
                         Exercise: Rectangular . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           26
                         Exercise: Calculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          26
                         Exercise: Standard Input         . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    26
                         Solution: Area of rectangular . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           26
                         Solution: Calculator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          28
                         Commandlinearguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                  29
                         Commandlinearguments-len . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                    29
                         Commandlinearguments-exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                   30
                         Exercise: Rectangular (argv) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            30
                         Exercise: Calculator (argv) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           30
                         Solution: Area of rectangular (argv)            . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   30
                         Solution: Calculator eval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           31
                         Solution: Calculator (argv) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           32
                         Compilation vs. Interpretation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            33
                         Is Python compiled or interpreted? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              33
                         Flake8 checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         34
The words contained in this file might help you see if this file matches what you are looking for:

...Pythonexamples gabor szabo this book is for sale at http leanpub com python examples version was published on a empowers authors and publishers with the lean publishing process act of an in progress ebook using lightweight tools manyiterations to get reader feedback pivot until you have right build traction once youdo gaborszabo contents first steps whatispython whatisneededtowriteaprogram thesource code vs installation linux apple mac osx ms windows editors ides documentation program types command line script hello world comments variables exercise whatisprogramming whataretheprogramminglanguages awritten human language aprogramminglanguage wordsandpunctuation matter literals value floating point limitation numpy rectangular numerical operations multiply string addnumbers addstrings calculations solution second modules amainfunction themainfunction called indentation conditional main input output i o print as if it exception syntaxerror missing parentheses call prompting user or raw b...

no reviews yet
Please Login to review.