[Python Tips] Underscores in Numeric Literals
programming·@themarkymark·
0.000 HBD[Python Tips] Underscores in Numeric Literals
 This is a simple tip but can be very useful to visualize large numbers quickly. This feature requires Python 3.6+. When expressing large numbers in Python, you are unable to use a comma `,` separator but you are now able to use an underscore `_` to make large numbers more readable. # Example time Right now my reputation is 95,772,209,949,706.000 when looked at in raw form. #### To express this in Python you typically would use. `themarkymark_rep = 95772209949706.000` #### With python 3.6 you can use underscores in your **numeric literals** like this `themarkymark_rep = 95_772_209_949_706.000` This doesn't change how your code functions in anyway but does make it easier to visualize the scale of the number. #### You can also use this when doing binary numbers such as `flags = 0b_0011_1111_0100_1110` # Python Tips Series * [f-strings in Python 3.6](https://steemit.com/programming/@themarkymark/python-tips-f-strings-in-python-3-6-and-why-you-should-be-using-them) <center><sub><sub> X48EJ </sub></sub></center> # <center> [Why you should vote me as witness](https://steemit.com/witness-category/@themarkymark/why-you-should-vote-for-themarkymark-as-witness) </center> # <center>https://steemitimages.com/DQmcWxV1dpA1eAtw2ipwZiWZkydyVNU5LaLa2Ak1GUnbGmS/The-Marky-Mark.png </center> # <center> Witness & Administrator of four full nodes </center> #  </br> # <center> My recent popular posts </center> # [STEEM, STEEM Power, Vests, and Steem Dollars. wtf is this shit?](https://steemit.com/steem/@themarkymark/steem-steem-power-vests-and-steem-dollars-wtf-is-this-shit) [The truth and lies about 25% curation, why what you know is FAKE NEWS](https://steemit.com/curation/@themarkymark/the-truth-and-lies-about-25-curation-why-what-you-know-is-fake-news) [WTF is a hardware wallet, and why should you have one?](https://steemit.com/bitcoin/@themarkymark/wtf-is-a-hardware-wallet-and-why-should-you-have-one) [GINABOT - The Secret to your Sanity on Steemit](https://steemit.com/ginabot/@themarkymark/ginabot-the-secret-to-your-sanity-on-steemit) [How to calculate post rewards](https://steemit.com/steemit/@themarkymark/how-to-calculate-post-rewards) [Use SSH all the time? Time for a big boy SSH Client](https://steemit.com/linux/@themarkymark/use-ssh-all-the-time-time-for-a-big-boy-ssh-client) [How to change your recovery account](https://steemit.com/steemit/@themarkymark/how-to-change-your-recovery-account) [How curation rewards work and how to be a kick ass curator](https://steemit.com/curation/@themarkymark/how-curation-rewards-work-and-how-to-be-a-kick-ass-curator) [Markdown 101 - How to make kick ass posts on Steemit](https://steemit.com/steemit/@themarkymark/markdown-101-how-to-make-kick-ass-posts-on-steemit) [Work ON your business, not in your business! - How to succeed as a small business](https://steemit.com/business/@themarkymark/work-on-your-business-not-in-your-business-how-to-succeed-as-a-small-business) [You are not entitled to an audience, you need to earn it!](https://steemit.com/steemit/@themarkymark/you-are-not-entitled-to-an-audience-you-need-to-earn-it) [How to properly setup SSH Key Authentication - If you are logging into your server with root, you are doing it wrong!](https://steemit.com/sysadmin/@themarkymark/how-to-properly-setup-ssh-key-authentication-if-you-are-logging-into-your-server-with-root-you-are-doing-it-wrong) [Building a Portable Game Console](https://steemit.com/raspberrypi/@themarkymark/building-a-portable-game-console) [](https://v2.steemconnect.com/sign/account-witness-vote?witness=themarkymark&approve=1)
👍 themarkymark, doverun, ipromote, nightdragon, chuckyfucky, ubg, assetminds, muzzls, armiaaceh, cryptogem, savemax, shintamonica, luisal314, natsch, makerhacks, freebornsociety, demartini, investfourmore, urs, hairshares, kessielynbote, daydreams4rock, gtmatze, rahul.stan, michellectv, tushy, zyl, baldos, danile666, hotvideos, poweredbyweb, mikepm74, nate-atkins, memesplease, alexpmorris, tngflx, shellyduncan, perthmint, solascriptura, epixar, thecryptodrive, nelkeljdm, shahab3211, saqibnazir, coincadet, andrewharland, playfulfoodie, nicnas, yulem, steemcenterwiki, kenistyles, germanaure, rogz06, deriom, abh12345, buzzbeergeek, dadview, adventureevryday, steemitcitizen, avesa, simplifylife, kriptonoob, andrekweku, patricklancaster, cryptogee, davinsh, suntree, derrick829, amos811, lexiconical, cifer, tymba, topkpop, cyber-smiley, steemusa, fortunex, vibvir, steemernoob, zeddjacob, jaynie, minhazahmed, kiddarko, docsmith, yamineko, realseb, upboater, anyx, kushed, stone1, steemychicken1, aizensou, b0y2k, stoner19, hagie, coinbar, platinum-blue, bigdaddy, kingsmind, romedog, spg, sammosk, stitchybitch, dream-o, ozchartart, berniesanders, nextgencrypto, danknugs, steemservices, thebotkiller, thecyclist, engagement, theyeti, yougotflagged, thedelegator, ngc, joseph, richman, razvanelulmarin, raymondspeaks, knozaki2015, shawnamawna, thebluepanda, yoshiko, thisisbenbrick, sirwinchester, einsteinpotsdam, zahnspange, steemsquad, allesgruen, dannystravels, jerryblanceton, ssekulji, timbernana, sherlockcupid, dark.horse, toyman, i-gordan, sunshinetraveler, eveuncovered, freefuture, kinakomochi, biancajapan, chickenfucker, pharesim, dzonyy, upmyvote, dorabot, saszka512, armia11, edb, drac59, imaverick, cicbar, sshappydayz, buy-bitcoin, safriadi98, shredz7, qurator, gregory-f, oleg326756, scrooger, samiwhyte, recordpool, theleapingkoala, peppermint24, shadowspub, dynamicrypto, blacklux, charlieb, sisygoboom, geekpowered, maxpatternman, gregoryarts, toshlenoir,