The Easiest Way to Replace If-Else in Python! Developer Shorts #shorts #coding #programming #python

preview_player
Показать описание
The Easiest Way to Replace If-Else in Python!

This tutorial will help you understand how to write a cleaner version of your code by replacing if-else conditions in a method with the help of dictionary in Python programming language.

#coding #programming #python #codingtips #codingtricks
Рекомендации по теме
Комментарии
Автор

Wow, you managed 3 wrong things in this village video.
1. return wheels_data.get(vehicle, 0)
2. Now the scope of that dictionary never going to end, and that memory will never be collect by GC
3. Who copy pastes variable names in a ide like vs code... Let the intellisense do it's just,

However, keep it up buddy.

rajveersingh
Автор

.get(key, "if not default value here")
is better and cleaner

hamdimohamed
join shbcf.ru