Alex C Warren
banner
alexcwarren.bsky.social
Alex C Warren
@alexcwarren.bsky.social
Software Engineer 💻 Aspiring Python Expert

I'm a professional software engineer on a journey to improve my skills. Follow me as I share what I've learned throughout my career and the things I'm learning now so that you, too, can improve.
For loops in Python can work like other languages:
e.g. "for (int i = 0; i < array.size(); i++)",
as seen in example A below.

It is better to use for loops in a "for-each" style, as seen in example B:
i.e. "for x in ...".

If you need the indices, example C is the way to go.
#Python #LearnPython
October 30, 2024 at 9:07 PM
In Python there are a few ways to format strings. One of the most powerful methods is known as an "f-string".

You can insert expressions within "{ }" in many different ways including a variable name followed by a "=".

This is great for quick debugging.

#Python #LearnPython
October 29, 2024 at 1:33 PM
Here's a (slightly) better screenshot of the output.
October 29, 2024 at 1:20 PM