This is to get started with Python
and try few concrete examples. It should help beginners to learn or others to do a quick revision without getting too deep.
Entire Jupyter notebook
can be downloaded or forked from my GitHub to look or play around: https://github.com/sandeep-mewara/python-examples
I started Python programming using Jupiter notebook web application. Later, I moved to
Visual Studio Code
that looked much user friendly.A guide on how to setup VS Code for Python is here.
Python basics includes:
- Variables
- Conditional statements
- String manipulations
- Type conversion
- Formatting strings
- Data Structure – List, Tuple
- Functions
- List comprehension
- Zip & Pack
# items are indexed by integers, starting from 0.
# % is a format operator and %d, %s, %f are special format sequences
# negative index is used to access list elements from the end
# [start:end:step] Returns a new list from start to end-1 with default step 1
# zip can merge two lists into a list of tuples
Key learning’s …
Examples notebook includes:
- Palindrome
- Sum of Squares
- Sort students marks list
- Format students marks list
- Word Frequency
# sometimes anonymous functions are enough
# storing data in dictionary as key-value pair helps
Key learning’s …
Keep learning!