Simple python question Part - 35 🤔. #programming2024 #codingchallenge #python #pythontricks #coding

preview_player
Показать описание
🔍 Dive into the world of Python programming! In this quick 7-second video, we explore a common pitfall that many developers encounter: Magic of List, Functions, Update and Copy.🐍

Ever wondered what if I declare X and then update it will it be a copy or update? 🤔 Watch as we see the use of this tricky concept, explain the underlying reason. Perfect for beginners and seasoned coders alike, this video offers essential insights that can help you write better Python code! 👉 Don't forget to like, subscribe, and hit the bell icon for more coding tips and tricks! Let's sharpen our Python skills together! 💻✨

#codingtips​ #coding​ #python​ #programming2024​ #trending​ #viralvideo​ ‪‪ ‪#programming #interviewquestions #pythoncoding #computerlanguage #trending #viralshorts #codingchallenge #codingtime #codingtutorial ‪ #programminglanguage #pyhton #pythontutorial @CodeWithHarry @developerRahul @ApnaCollegeOfficial @freecodecamp
Music track: Living by Aylex
Vlog Music for Video (Free Download)
Рекомендации по теме
Комментарии
Автор

Good try! But here's the correct output:
5
[10, 10, 15]

### Explanation:
- **`x` remains 5**: In the function, `num += 5` modifies only the local variable `num` (a copy of `x`). It doesn’t affect the original `x`.
- **`y` becomes `[10, 10, 15]`**: Lists are mutable, so when `lst[0] += 5` is executed, it directly modifies the first element of the original list `y`.

Nice effort! Want to try another? 😊

tbkprogrammer
join shbcf.ru