What this text is and what it is not: This text is intended to introduce the reader to the basics of the Python programming language in the sense that they will be able to write minimal types of programs and run the code. It is not intended to go into advanced topics like concurrency and use of pointers, data structures, object oriented programming, testing and debugging techniques and other software engineering principals.
The programs are intended to be run in the terminal as that is common to most operating systems. Linux and Mac come preinstalled with a terminal. Windows may or may not have it pre-installed. "Windows Terminal" can be installed from the Microsoft store. Just do a search for it and install it.
To setup Python for use, navigate to the python.org website and select downloads. Select the appropriate download for your operating system. Install and follow the directions on how to perform further settings for use. If the language has been installed properly you will be able to type the following command in the terminal command line and receive the response shown:
$ python --version
Python 3.9.13
(Note: the version shown here varies with your installed version)
A statement is an instruction that a program can execute. They are usually made line by line in your coding file. Lines in your code can have multiple statements that are separated typically by semicolons.
Comments are used to document what your code does so that others can understand it when reviewing your code. Comments also document items that are non-performant in order to debug the code items at a later date.
| break | case | chan | const | continue |
| default | defer | else | fallthrough | for |
| func | go | goto | if | import |
| interface | map | package | range | return |
| select | struct | switch | type | var |
a. +: add numbers
b. -: subtract numbers
c. /: divide one number by another
d. %: remainder of dividing one number by another
e.
a. String, string, str: used for storing text and/or characters
b. Char, char, Character, character: a single character/letter/number, or ASCII values, UTF-8 code unit
c. wchar: UTF-16 code unit
d. dchar: UTF-32 code unit and Unicode code point
e. Numbers
Number, number, numeric: stores numeric data with or without decimal
Int8, int8, i8,sbyte: stores positive or negative integers from -2^7 to (2^7)-1, with 3 significant figure precision
Int16, int16, i16, Short, short: stores positive or negative integers from -2^15 to (2^15)-1, with 5 significant figure precision
Int32, int32, i32, Int, int, Integer, integer: stores positive or negative integers from -2^31 to (2^31)-1, with 10 significant figure precision
Int64, int64, i64, bigint, Long, long: stores positive or negative integers from -2^63 to (2^63)-1, with 19 significant figure precision
Int128, i128: stores positive or negative integers from -2^127 to (2^127)-1, with 39 significant figure precision
isize: same as i32 or i64 depending on computer architecture
UInt8, unint8, u8, ubyte, Byte, byte, bytes: stores positive integers from 0 to (2^8)-1, with 3 significant figure precision
UInt16, unint16, u16, ushort: stores positive integers from 0 to (2^16)-1, with 5 significant figure precision
UInt32, uint32, unint32, u32, uint: stores positive integers from 0 to (2^32)-1, with 10 significant figure precision
UInt64, uint64, unint64, u64, ulong: stores positive integers from 0 to (2^64)-1, with 19 significant figure precision
UInt128, u128: stores positive integer numbers from 0 to (2^128)-1, with 39 significant figure precision
usize: same as u32 or u64 depending on computer architecture
Real, real: either the largest floating point type that the hardware supports, or double; whichever is larger
Float16: stores fractional numbers from -2^15 to (2^15)-1, with 5 significant figure precision
Float32, float32, f32, Float, float: stores fractional numbers from -2^31 to (2^31)-1, with 10 significant figure precision
Double, double, Float64, float64, f64: stores fractional numbers from -2^63 to (2^63)-1, with 19 significant figure precision
decimal: stores numbers from -7.9E-28 to +7.9E28 (28 digits of precision)
BigRational: construction of number from an i32 numerator and i32 denominator
Complex, complex, cfloat: complex number type made of two floats
cdouble: complex number type made of two doubles
creal: complex number type made of two reals
ifloat: imaginary value type of float
idouble: imaginary value type of double
ireal: imaginary value type of real
a. Arrays
a. Input casting: type casting of input variables for the purpose of processing the data with the appropriate data type b. Handling Errors from incorrect input types: Errors will occur from time to time when the data provided by the user is in the incorrect data type for the program to process the data. When errors occur the program will need instruction on what to do in that instance. Otherwise it will terminate with a warning or an error.
2. Command Line Output: command line output will be in the form of numbers, strings, booleans and characters produced by a output keyword such as print, println, PrintLn!, console.log(), ConsoleWriteLine(), etc.
a. String Formatting: strings can be formatted to produce a specific output format based upon numbers, strings, booleans and their presentation types
5. while-let: while let destructures a variable into another variable perform a block of code else break
a. Input casting.
b. Handling Errors from incorrect input types.
c. json
d. html
e. xml
f. csv
a. String Formatting
b. json
c. html
d. xml
e. csv