Sitemap

Python — Basic Review before diving deeper 10

Want to recall the memory of Python easily?

Press enter or click to view image in full size

This is the note taken when I learned Python “again”, hope it helps you too.
There are additional links in the article for you to understand further information.

BTW. I just start my journey with break-the-ice-with-python ☃️🔥
💠My solutions are here

Quick tip |
Find ⚡ for each topic

☘️Directory

🔹Modules

🔹Built-in Modules

🔹pip install

🔹debug

🔹file path

❤️Good Resources

ZeroToMastery | Pyhton
Codes in Github

⚡Modules

More in W3Schools
More in RealPython

🔹A file contains functions

🔹like a code library

Press enter or click to view image in full size

🔹Syntax — from <module_name> import <name(s)>

Press enter or click to view image in full size
main.py
Press enter or click to view image in full size
utility.py
Press enter or click to view image in full size
cart.py
Press enter or click to view image in full size
output

⚡Built-in Modules

More in Python Doc

🔸sys.argv

Press enter or click to view image in full size
Press enter or click to view image in full size

🔸random

Example in W3Schools

We have seen this before.

Press enter or click to view image in full size

🔸collections

🔹Counter

Press enter or click to view image in full size
Press enter or click to view image in full size

🔹defaultdict

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

🔹OrderDict

Press enter or click to view image in full size

⚡Guess a number

Exercise 12

Press enter or click to view image in full size
Press enter or click to view image in full size

🔸What if we use sys.argv?

Make sure you try it in the machine instead of replit online.

Get Yen Wang’s stories in your inbox

Join Medium for free to get updates from this writer.

sys.argv doesn’t work for the website.

Press enter or click to view image in full size
Press enter or click to view image in full size

⚡pip install

More in pip.PyPI

pip Comes with Python3 after installation

Press enter or click to view image in full size

Open PyCharm

Press enter or click to view image in full size

Try pyjokes now.

Press enter or click to view image in full size
Press enter or click to view image in full size

⚡Debug

🔹Linting

🔹ide/ editor

🔹read errors

🔹debug module

More in GeeksforGeeks

🔸pdb Module

Press enter or click to view image in full size

⚡File I/O

Press enter or click to view image in full size

🔸File

Press enter or click to view image in full size

🔸Read, write & append

Press enter or click to view image in full size

🔹mode = ‘ r ‘

Press enter or click to view image in full size
Press enter or click to view image in full size

🔹mode = ‘ r+ ‘

Press enter or click to view image in full size
Press enter or click to view image in full size

🔹write

Press enter or click to view image in full size

🔹mode = ‘w’

This will overwrite all the file.

Press enter or click to view image in full size

🔹Create a new file

Press enter or click to view image in full size