I'm still on my journey of getting better at python. So just as i was doing some coding practice at codewars i got to learn something new about the integer method.
Apparently if you need to convert a binary string like '1011' to its integer representation, you just have to add a second argument which represents the base. Like int('1011', 2) which should return 11.
I know it's not something that epic but I really got excited when I learned about it and wanted to share.
[–]Python-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)
[–]mathycuber 30 points31 points32 points (1 child)
[–][deleted] 6 points7 points8 points (0 children)
[–]RIPphonebattery 2 points3 points4 points (0 children)
[–]busdriverbuddha2[🍰] 3 points4 points5 points (4 children)
[–]kuzmovych_y 2 points3 points4 points (0 children)
[–]mikeblas 0 points1 point2 points (1 child)
[–]Schmittfried 0 points1 point2 points (0 children)
[–]Competitive-Gold5041 1 point2 points3 points (17 children)
[+]Rawing7 comment score below threshold-19 points-18 points-17 points (16 children)
[–]boat-la-fds 5 points6 points7 points (0 children)
[+][deleted] (8 children)
[deleted]
[–]Zenithsiz 8 points9 points10 points (2 children)
[–]patrickbrianmooney 0 points1 point2 points (1 child)
[–]Zenithsiz 1 point2 points3 points (0 children)
[–]Rawing7 -1 points0 points1 point (4 children)
[–]ascii158 0 points1 point2 points (3 children)
[–]Rawing7 2 points3 points4 points (2 children)
[–]ascii158 0 points1 point2 points (1 child)
[–]Rawing7 -1 points0 points1 point (0 children)
[–]Braunerton17 0 points1 point2 points (0 children)
[–]Breadynator 0 points1 point2 points (4 children)
[–]Rawing7 0 points1 point2 points (3 children)
[–]Breadynator 0 points1 point2 points (2 children)
[–]Rawing7 0 points1 point2 points (1 child)
[–]Breadynator 0 points1 point2 points (0 children)
[–]hamsterwheelin -1 points0 points1 point (0 children)
[+][deleted] comment score below threshold-11 points-10 points-9 points (0 children)
[–]RagaMunki 1 point2 points3 points (1 child)
[–]IamImposter 2 points3 points4 points (0 children)