Trending

Latest Posts by

I hope you enjoyed learning about #Python string formatting using the `format()` method

Be sure to follow me for more Python tips and tricks! 🐍🔥

1 day ago 0 0 0 0
Post image

The `format()` method also allows you to set the string alignment.

Here are a few examples:

1 day ago 1 0 1 0
Post image

If you put integers within the curly braces, then you can control which argument goes where (although this is probably the most confusing way to do it)

1 day ago 0 0 1 0
Post image

You can also just use named parameters and skip the dictionary:

1 day ago 0 0 1 0
Post image

You can also use a #Python dictionary when using the `format()` method to use named parameters:

1 day ago 0 0 1 0
Post image

What happens when you have too many braces, though?

Well, you get an error! 🐍⚠

1 day ago 0 0 1 0
Post image

When you use `format()`, you still use curly braces in your string. Then you pass in the same number of arguments as you have braces:

1 day ago 0 0 1 0

Before #Python f-strings, you had to call format()

Sometimes you still do, so it's good to learn about it!

Check out this mini thread on the topic

🐍🧵👇

1 day ago 1 0 1 0
Advertisement
Post image Post image

How to creae a pie chart with a popped out section using #Python and #matpllotlib 🐍🔥

2 days ago 1 0 0 0
Post image Post image

How to add multiple figures with #Python and #matplotlib

3 days ago 0 0 0 0
Post image Post image

How to add a legend to a bar chart using #Python and #matplotlib 🐍🔥

5 days ago 1 0 0 0
Post image

Did you know you can create your own custom iterators in #Python?

All you need to do is write your own custom `__iter__` and `__next__` methods

Here's an example:

5 days ago 3 0 0 0
Preview
Python Pop Quiz - Number Explosion - Mouse Vs Python You will sometimes come across examples of code that use one or two asterisks. Depending on how the asterisks are used, they can mean different things to Python. Check your understanding of what a single asterisk means in the following quiz! The Quiz What will be the output if you run this code? numbers = […]

You can check out one of them here:

blog.pythonlibrary.org/2026/04/02/...

6 days ago 1 0 0 0

I have started posting #Python Pop Quizzes in my newsletter and on my blog @mousevspython 🐍❓

These quizzes include the answers too!

6 days ago 1 0 1 0
Post image

#Python lambda craziness 🐍🤪

It's lambdas all the way down!

6 days ago 0 0 0 0
Post image

How to check if a string is printable or not in #Python 🐍🤯

6 days ago 2 0 0 0
Post image

There are several different ways to create an empty dictionary with #Python

Here are two of them:

1 week ago 1 0 0 0
Post image

How to use #Python and a defaultdict to return a custom message if the key does not exist in the dictionary 🐍🚀

1 week ago 3 0 0 0
Advertisement
Post image Post image

How to create a bar chart with #Python and #matplotlib 🐍📊

1 week ago 4 0 0 0
Post image

Want to grab just the filename from a path in #Python? You can do that too with pathlib! 🐍🔥

1 week ago 0 0 0 0
Post image

Need to get the parent folder of a path in #Python? Use pathlib! It makes working with paths so easy!

1 week ago 0 0 0 0

Here's a link to see all my products:

driscollis.gumroad.com/

1 week ago 0 0 0 0
Post image

#Python Tax Day Sale is on! Save 30% of any of my Python books or courses using the following coupon code: TAXDAY26

Note: The photo below does not show all my books!

1 week ago 1 0 1 0
Post image Post image

There are lots of #Python GUI frameworks. Have you tried out dearpygui yet?

Here's a quick demo they have provided:

1 week ago 1 1 0 0

I have been a #Python programmer for 20 years now!

I have used Python for all the following and more:

🐍 Automation
🐍 GUIs
🐍 PDF creating, scraping, etc
🐍 Excel
🐍 Login scripts
🐍 Testing C++ / Python
🐍 Websites
🐍 and much more

Ask me anything!

2 weeks ago 0 0 0 0

Learn more here:

openai.com/index/opena...

2 weeks ago 0 0 0 0
Advertisement

Astral, the company behind the amazing Ruff, uv, and ty applications, is being acquired by OpenAI

What do you think about this new update?

2 weeks ago 1 0 1 0
Post image

What have you used a #Python async comprehension for lately? 🐍❓

3 weeks ago 1 0 0 0
Post image

Did you know that you can check if an instance is one of multiple classes in #Python?

Here's how to do it:

3 weeks ago 1 0 0 0
Preview
60 Best Python Blogs to Follow in 2026 FeedSpot brings you the best list of Python blogs, ranked by relevance, online following, and freshness to keep you connected with the latest voices

The Mouse vs Python blog is back on the top 60 #Python blog list again this year along with many of my other friends!

bloggers.feedspot.com/python_blogs

3 weeks ago 0 0 0 0