Open in app

Sign in

Write

Sign in

Liu Zuo Lin
Liu Zuo Lin

30K Followers

Home

Lists

About

Published in

Level Up Coding

·Pinned

30 Python Concepts I Wish I Knew Way Earlier

# Stuff I wish I Learnt Much Earlier in my Python Journey — Everyone’s Python journey is different, and we all learn different concepts at different speeds, in different sequences. But some things ay off a lot more when you learn them early. Here are 30 Python concepts I wish I learn much earlier in my own Python journey. 1) f-strings (formatted strings) I was taught to…

Python

14 min read

30 Python Concepts I Wish I Knew Way Earlier
30 Python Concepts I Wish I Knew Way Earlier
Python

14 min read


Published in

Level Up Coding

·Pinned

10 Tools That Vastly Brighten Up My Coding Experience

# My Updated Home-Office Setup — If you do work from home sometimes, I do recommend getting some of these to brighten up your coding experience too! 1) A long long screen Mine is a 34-Inch monitor from Dell with a longer-than-normal screen aspect ratio. Longer screen == more screen real estate == happier coding 2) External screens I work from my laptop (16-Inch…

Software Engineering

4 min read

10 Tools That Vastly Brighten Up My Coding Experience
10 Tools That Vastly Brighten Up My Coding Experience
Software Engineering

4 min read


Published in

Level Up Coding

·Pinned

Return VS Yield in Python — A Short Comic

# Why ‘yield’ can make your Python code faster — And this problem gets worse the more data we deal with. What if there are 1000 people in the line? The ‘return’ keyword def add10(x): return x + 10 x = add10(4) # x = 14 def get_takoballs(orders): output = [] for order in orders: output.append(f'{order} takoballs')…

Python

3 min read

Return VS Yield in Python — A Short Comic
Return VS Yield in Python — A Short Comic
Python

3 min read


Published in

Level Up Coding

·Pinned

20 Python Concepts I Wish I Knew Way Earlier

# Stuff I wish I learnt earlier as a beginner — There are lots of concepts we need to grasp in Python. And everyone learns them differently, in different sequences. Here are some things I wish I learnt much earlier when I was still a Python beginner. 1) Tuple Unpacking + Tuple Unpacking With * person = ['bob', 30, 'male'] name, age, gender = person # name='bob, age=30, gender='male' …

Python

9 min read

20 Python Concepts I Wish I Knew Way Earlier
20 Python Concepts I Wish I Knew Way Earlier
Python

9 min read


Published in

Level Up Coding

·Pinned

48 Things I Never Knew About Python Until Recently (Compilation)

# this list keeps getting longer — 1) We can set variables dynamically using globals() a = 4 b = 5 ^ this is the same as: globals()['a'] = 4 globals()['b'] = 5 globals() is a dictionary containing all global variables, and we can set variables by add key-value pairs into globals(). (don’t do this in production code tho) 2) re.sub can take in functions # replacing vowels with - import re x…

Python

11 min read

48 Things I Never Knew About Python Until Recently (Compilation)
48 Things I Never Knew About Python Until Recently (Compilation)
Python

11 min read


Published in

Level Up Coding

·1 day ago

6 Things I Never Knew About Pandas Until Recently

Day 33 of exprimenting with video content. 1) ~ can be used to invert stuff in Pandas import pandas as pd df = pd.DataFrame([ [1,2,3], [1,2,4], [None,2,4], [2,2,3], [None,2,4] ], columns=['a', 'b', 'c']) df1 = df[df['a'].isna()] print(df1) # a b c # 2 NaN 2 4 # 4 NaN 2 4 df2 = df[~df['a'].isna()] print(df2) #…

Python

3 min read

6 Things I Never Knew About Pandas Until Recently
6 Things I Never Knew About Pandas Until Recently
Python

3 min read


Published in

Level Up Coding

·3 days ago

9 Pip Commands That Make Your Life Easier

# and less painful when installing Python packages — Day 32 of experimenting with video content The 9 Commands pip install numpy # installs the external library numpy pip install numpy pandas colorama # installs numpy, pandas and colarama together pip install --upgrade numpy # upgrades numpy to latest version on repository pip install -r requirements.txt # installs everything inside requirements.txt

Python

2 min read

9 Pip Commands That Make Your Life Easier
9 Pip Commands That Make Your Life Easier
Python

2 min read


3 days ago

Prompting for User Input in Python using input()

# Python From Zero To One — Part 7 — Day 31 of experimenting with video content input() in a nutshell name = input('what is your name? ') print(name) ^ the built-in input() function allows us to prompt the user to type in something eg. name, age etc. Whatever the user types will be stored as a string value in the name variable…

Python

2 min read

Prompting for User Input in Python using input()
Prompting for User Input in Python using input()
Python

2 min read


Published in

Level Up Coding

·3 days ago

7 Things I Recently Knew About Python Classes & OOP

# eg. controlling object behaviour with ~ — Day 30 of experimenting with video content 1) reflected arithmetic operators class Dog: def __add__(self, x): return 'apple' def __radd__(self, x): return 'orange' dog = Dog() print(dog + 1) # apple print(1 + dog) # orange Reflected arithmetic magic methods are used when we use something + object rather than object + something. 2) __getattr__ vs __getattribute__

Python

3 min read

7 Things I Recently Knew About Python Classes & OOP
7 Things I Recently Knew About Python Classes & OOP
Python

3 min read


Published in

Level Up Coding

·4 days ago

Using Python To Send Telegram Messages To Yourself

# In a few lines of code — Day 29 of experimenting with video content STEPS create Telegram bot using BotFather on Telegram get Telegram bot token from BotFather on Telegram get CHAT_ID using /getUpdates function use /sendMessage to actually send the Telegram message to yourself # URL TO GET CHAT_ID url = f"https://api.telegram.org/bot{TOKEN}/getUpdates" # ULR TO ACTUALLY SEND…

Python

1 min read

Using Python To Send Telegram Messages To Yourself
Using Python To Send Telegram Messages To Yourself
Python

1 min read

Liu Zuo Lin

Liu Zuo Lin

30K Followers

Software Engineer + Writer (zlliu.co | zlliu.co/ebooks)

Following
  • Tim Denning

    Tim Denning

  • Josef Cruz

    Josef Cruz

  • Aldric Chen

    Aldric Chen

  • Sean Kernan

    Sean Kernan

  • Shunyu (Andy) Tang

    Shunyu (Andy) Tang

See all (56)

Help

Status

About

Careers

Blog

Privacy

Terms

Text to speech

Teams