3 - Introduction To Python Programming I
3 - Introduction To Python Programming I
Mechatronic Systems
6. It is free!
▪ “Anaconda Individual Edition” is the free version we used here. The link for
downloading and installation on your computer is below:
https://www.anaconda.com/products/individual
▪ Dynamic Typing:
▪ In Python you may reassign variables to different data types
▪ Strings are ordered sequence means we can use Indexing and Slicing
▪ Slicing
▪ Nesting Lists
▪ Reassigning an element
▪ Note: When a file is read completely the reading “cursor” will be at the end
of the file. So, if we try to read the file again the output will be ‘’. We can
reset the “cursor” using seek(cursor_position) method.
▪ w: Opens in write-only mode. The pointer is placed at the beginning of the file and this will
overwrite any existing file with the same name.
▪ w+: Opens a file for writing and reading.
▪ Opening a file with 'w' or 'w+’ will delete all the contents of a file
▪ a: Opens a file for appending new information to it. The pointer is placed at the end of the file.
▪ a+: Opens a file for both appending and reading.
▪ If the file does not exist, one will be created.
▪ Note: When working with a file is done, make sure you close it using close() method.
▪ for Loops: “For loops” are used for sequences or other iterable items such
as lists, strings, tuples, dictionaries….