Python format function tutorial: Formatting output: strings, floats, integers, columns

preview_player
Показать описание
In this video, I demonstrate using Python's built in format function for formatting output in the Python shell.

Examples include formatting strings, floating point numbers, percents, field width, integers, e notation, formatting output into columns, and more.

// Consider supporting this channel in multiple ways
Bitcoin: 177wfkQwzXiC8o2whQMVpSyuWUs95krKYB

An alternative to using the format function is to use format strings. You can watch a video I did covering them here:

Check out all my Python videos by visiting my Python playlist:

An early attempt at an introduction series for Python:
Рекомендации по теме
Комментарии
Автор

This was very well laid out and easy to understand, best tutorial I've come across on formatting in Python.

loreleicerulean
Автор

Great Python videos! So far, I've watched a number of them in your "Python Programming for Everyone" playlist and they all have been informative with all of the information presented in a logical sequence. I also have enjoyed seeing IDLE on the right and the Python Shell on the left; this makes for a very fast yet concise way of demonstrating small pieces of the language. Nicely done! I found your videos by looking for beginner Python videos using IDLE; it seems most of the other beginner tuts start by adding the extra complexity of learning an IDE outside of what comes with Python. Thanks again for these videos. I'm just getting back to Python after being away from it for quite a while (it's a hobby, not my day job) and have refreshed what I had learned before but also learned some new things.

ImaginethenMake
Автор

Great video. I am trying to learn Python, so I wrote a program to answer Leonardo of Pisa's rabbit problem. I generated the right answer, but I needed to format my output. This video is a great help. Thanks, Dennis Quane

dennisquane
Автор

Lovely explained, thank you Professor :)

farazhassan
Автор

Thank you for sharing Hank, thumbs up!

gabrielkkim
Автор

Great video. Helped explain things I had confused, but the red text is a bit hard to see.

fizixx
Автор

brother help us the video how to change this number 76896 to replac 2 to remove 8 to be come like this 76296 using python.

johnmwansa
Автор

Dennis Quane
Great video. Sometime in the future could you explain how I could send my program in python to a friend?

dennisquane
Автор

< is symbol for hard left .. & default is hard right > .. the political symbolism of Python!

tertia
Автор

great video, how you print the strings and the integer in the same line for example like:

One hundred 100

like in a group

BlaZackk
Автор

please i need the video how to format numbers.what i mean is 14253165243164 i need to change a tow number is here on that number ok let say i need to place 5.2 with a defrent number were there is 5 i replce with 0.on 2 replce with 7 so video pls.

johnmwansa