Khalid | Python Tasks Adventurer ๐ retweeted

Khalid | Python Tasks Adventurer ๐@Python__TaskJul 12
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐บ๏ธ My Python book is now available!
๐ Python Tasks Adventures
240 total components โ tasks, bonus tasks, tips, and exercises covering a wide range of Python concepts.
From spy encryption to restaurant queues to Olympic systems.
You don't just learn Python. You practice it.
โ
700+ pages
โ
Beginner to Advanced
โ
Every solution fully explained
๐ฅ Launch price: $34.99 for 2 weeks only โ then $44.99
๐ amazon.com/dp/B0H7NKVFX6
โโโโโโโโโโโโโโโ
๐ BEFORE YOU DECIDE โ SEE IT FOR YOURSELF
๐ Read a sample task here โ drive.google.com/file/d/1jjXโฆ
๐ Read more samples free on Amazon โ amazon.com/dp/B0H7NKVFX6
One page. Real story. Real code. Real explanation.
That's the standard of all tasks.
โโโโโโโโโโโโโโโ
#Python #LearnPython #PythonTips #100DaysOfCode #CodeNewbie

Khalid | Python Tasks Adventurer ๐@Python__TaskOct 20
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
Python Quiz ๐
Before you scroll, check that if one more time. ๐
You type "no". What does this code print?
A) Continuing
B) Maybe next time!
C) An error
Whatโs your pick?
#Python #LearnPython #PythonTips #100DaysOfCode #CodeNewbie
Khalid | Python Tasks Adventurer ๐ retweeted

Khalid | Python Tasks Adventurer ๐@Python__TaskOct 12
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐ Make It Pythonic
Some string tricks look clever at first.
Then someone reads the code later and needs a small map. ๐
Instead of writing:
name = "sara"
message = ("Hi, " + name.title() + "!").replace("Hi", "Welcome")
โจ Write it the Pythonic way:
name = "sara"
display_name = name.title()
message = f"Welcome, {display_name}!"
The second version uses simple steps with clear names.
It is easier to read, easier to change, and easier to trust.
Make it short when you can, clear when you must. ๐
#Python #PythonCode #Coding #Programming #CodeNewbie #100DaysOfCode #PythonTips

Khalid | Python Tasks Adventurer ๐@Python__TaskOct 12
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐ Make It Pythonic
Some string tricks look clever at first.
Then someone reads the code later and needs a small map. ๐
Instead of writing:
name = "sara"
message = ("Hi, " + name.title() + "!").replace("Hi", "Welcome")
โจ Write it the Pythonic way:
name = "sara"
display_name = name.title()
message = f"Welcome, {display_name}!"
The second version uses simple steps with clear names.
It is easier to read, easier to change, and easier to trust.
Make it short when you can, clear when you must. ๐
#Python #PythonCode #Coding #Programming #CodeNewbie #100DaysOfCode #PythonTips
Khalid | Python Tasks Adventurer ๐ retweeted

Khalid | Python Tasks Adventurer ๐@Python__TaskAug 10
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
"AI wrote your code. Cool. Do you know if it's lying to you?"
"AI does everything now, why learn Python?" โ sure, and my GPS does everything too, until it confidently sends me into a lake. ๐๐
AI writes fast. It doesn't always write right. And if you can't read the code, you can't catch the bug โ you're just trusting a very confident robot with your project.
Python Tasks Adventures โ 240 tasks built to make you actually understand what your code does, so you're the one catching AI's mistakes, not the one drowning in them.
๐ Free sample: drive.google.com/file/d/1jjXโฆ
๐ Amazon: amazon.com/dp/B0H7NKVFX6
#Python #LearnPython #Programming #PythonTips #100DaysOfCode #CodeNewbie #TechBooks #Claude #ChatGPT #Copilot #Gemini
Khalid | Python Tasks Adventurer ๐ retweeted

Khalid | Python Tasks Adventurer ๐@Python__TaskOct 5
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐ Python Tip: When to Use Separate ifs Instead of elif
Should you use elif or another if? ๐
If you want both actions to happen when both conditions are true, use two separate ifs. Hereโs a little example ๐
number = 6
if number % 2 == 0:
print("Divisible by 2!")
elif number % 3 == 0:
print("Divisible by 3!")
Youโll only see โDivisible by 2!โ โ Python skips the elif once the first condition is true.
But 6 is divisible by both! Give each condition its own if:
if number % 2 == 0:
print("Divisible by 2!")
if number % 3 == 0:
print("Divisible by 3!")
Use elif to choose one branch. Use separate ifs when multiple branches may need to run.
#Python #PythonTips

Khalid | Python Tasks Adventurer ๐@Python__TaskOct 5
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐ Python Tip: When to Use Separate ifs Instead of elif
Should you use elif or another if? ๐
If you want both actions to happen when both conditions are true, use two separate ifs. Hereโs a little example ๐
number = 6
if number % 2 == 0:
print("Divisible by 2!")
elif number % 3 == 0:
print("Divisible by 3!")
Youโll only see โDivisible by 2!โ โ Python skips the elif once the first condition is true.
But 6 is divisible by both! Give each condition its own if:
if number % 2 == 0:
print("Divisible by 2!")
if number % 3 == 0:
print("Divisible by 3!")
Use elif to choose one branch. Use separate ifs when multiple branches may need to run.
#Python #PythonTips

Khalid | Python Tasks Adventurer ๐@Python__TaskOct 1
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
Every Python beginner meets this error at some point:
AttributeError: 'NoneType' object has no attribute 'upper'
Here is the tricky part. Python points at the line where the None was used, but the real mistake is usually somewhere else. Like this:
def make_greeting(name):
greeting = "Hello, " + name
print(greeting)
message = make_greeting("Ada")
print(message.upper())
Python points at the last line. But the bug is in make_greeting: it prints the greeting instead of returning it, so it quietly hands back None.
Finding that by hand is the "trace back" work every tutorial tells you to do. There is now a small tool that does it for you. Add two lines at the top of your program and the error message gains a few extra lines: which function returned the None, on which line, why, and how to fix it.
It's called nonetrace. pip install nonetrace
pypi.org/project/nonetrace/
#Python
Python Hub@PythonHubSep 30Ukraine
UkraineConnected via Ukraine App StoreAccount-level information, not a live location or per-post device.
nonetrace: tells you where a None came from when Python crashes on it
When Python crashes on None, it points at the wrong line. nonetrace shows which call returned the None, why, and the fix.
pypi.org/project/nonetrace/

Khalid | Python Tasks Adventurer ๐@Python__TaskSep 30
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐ Make It Pythonic
When you need both the position and the item, do not make Python walk through indexes first.
Instead of writing:
fruits = ["apple", "banana", "mango"]
for i in range(len(fruits)):
print(i, fruits[i])
โจ Write it the Pythonic way:
fruits = ["apple", "banana", "mango"]
for i, fruit in enumerate(fruits):
print(i, fruit)
enumerate() gives you two things at once:
the index and the item.
So the loop becomes easier to read.
#Python #PythonCode #Coding #Programming #CodeNewbie #100DaysOfCode #PythonTips
Khalid | Python Tasks Adventurer ๐ retweeted

Khalid | Python Tasks Adventurer ๐@Python__TaskAug 1
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐ Python has two ways to reach the first item:
x[0]
Normal entrance. ๐ช๐
x[-len(x)]
The Python snake climbed through the window, crossed the roof, and still arrived at the same place. ๐๐
#Python #LearnPython #PythonTips #100DaysOfCode #CodeNewbie
Khalid | Python Tasks Adventurer ๐ retweeted

Khalid | Python Tasks Adventurer ๐@Python__TaskSep 24
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐ Python Quiz:
What makes the last line get flagged when using /, while replacing it with // removes the warning?
#Python #Python #Pygame #Coding #Programming #PythonTips

Khalid | Python Tasks Adventurer ๐@Python__TaskSep 29
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
Many Python accounts and educators on YouTube built their audiences by sharing Python tutorials, tips, libraries, and toolsโฆ then packed their bags for AI.
Python is still here, waiting for a post or two.
@driscollis, still here keeping Python going ๐ What's your take on everyone else moving on?
#Python #PythonTips #100DaysOfCode

Khalid | Python Tasks Adventurer ๐@Python__TaskSep 24
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐ Python Quiz:
What makes the last line get flagged when using /, while replacing it with // removes the warning?
#Python #Python #Pygame #Coding #Programming #PythonTips

Khalid | Python Tasks Adventurer ๐@Python__TaskSep 13
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
Small thing I made: guardlist.
You know how modifying a list inside a for loop silently skips items?
Python protects dicts from that but not lists. GuardedList fixes that with a proper error message.
pip install guardlist
pypi.org/project/guardlist/
#Python
#Python #Pygame #Coding #Programming #PythonTips
@driscollis
Khalid | Python Tasks Adventurer ๐ retweeted

Khalid | Python Tasks Adventurer ๐@Python__TaskAug 24
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐ A year of work turning Python into an adventure.
PyAdventure โ a free learning game built entirely with Pygame.
๐ Travel through 10 unique worlds, from Ancient Forests and Desert Ruins to Frozen Lakes, Mystic Archives, and Sky Castles.
But every world is more than a new landscape.
Each one teaches a real Python concept:
โ๏ธ Variables and data types
โ๏ธ Conditions and loops
โ๏ธ Lists and dictionaries
โ๏ธ Functions and error handling
โ๏ธ Object-oriented programming
โฆand more.
Answer questions. Overcome obstacles. Unlock the gate. Enter the next world.
And waiting at the end is the Dragon of Truth ๐
A real final battle where every Python skill you have learned is put to the test.
Can you master Python and defeat the Dragon?
๐ฎ Free. Windows download.
khalidmfy.itch.io/pyadventurโฆ
#Python #100DaysOfCode #CodeNewbie
Khalid | Python Tasks Adventurer ๐ retweeted

Khalid | Python Tasks Adventurer ๐@Python__TaskJun 4
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
Pythonistas ๐โจ
Iโd appreciate your support.
If you enjoy Python tips and clean code ideas, please support the account with a repost and a follow ๐๐ฅ
Your support helps the content reach more Python learners and developers.
Thank you
#Python #PythonCode #Coding #Programming #CodeNewbie #100DaysOfCode #Developer #AI #PythonTips

Khalid | Python Tasks Adventurer ๐@Python__TaskAug 28
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
Replying to @bbelderbos
b. {'a': 1, 'b': 99, 'c': 4}
A small related detail:
{'b': 99, 'b': 7}
Python keeps only the last value for the duplicate key, so this becomes {'b': 7}.

Khalid | Python Tasks Adventurer ๐@Python__TaskAug 27
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
๐๐ฎ Pygamers, what do you think happens here?
Look carefully at the order of these lines:
screen = pygame.display.set_mode((600, 400))
pygame.draw.circle(screen, "white", (300, 200), 60)
screen.fill("green")
pygame.display.update()
What will appear on the screen?
A) A white circle on a green background
B) Only a green background
C) Only a white circle
D) An error
Whatโs your answer? ๐
#Python #Pygame #Coding #Programming #PythonTips

Khalid | Python Tasks Adventurer ๐@Python__TaskAug 26
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
Replying to @jlmillard
Thanks for asking! Honestly, it assumes a little Python already โ the questions ask you to read a snippet and predict what it does, so a complete beginner would be guessing.
But World 1 starts at the basics, and if you sit with him for it, it could be a good way in โ he plays, you explain. It's free, so worth a try together. Let me know how he finds it!

Khalid | Python Tasks Adventurer ๐@Python__TaskAug 25
West Asia
West AsiaConnected via West Asia Android AppAccount-level information, not a live location or per-post device.
Replying to @driscollis
Thanks Mike, that's very kind ๐
The final Dragon of Truth battle took the longest to build โ would love to hear what you think if you play it.










