Vimal Thapliyal’s Post

Quick check: what’s the type of bin(10)? int? float? Something else? It’s str. bin(), oct(), and hex() always return strings. That’s why bin(10) + 5 fails and why you use int(bin(10), 2) when you need a number again. I wrote a complete guide to Python base conversion functions so you can: ✓ Use bin(), oct(), and hex() correctly ✓ Know they return strings (and convert back when needed) ✓ Avoid float/complex (only int and bool work) ✓ Fix the usual mistakes and read the common errors ✓ See practical use (e.g. colors, permissions) and try exercises ~23 min read, with examples and solutions. Link: https://lnkd.in/dnUxjXBB #Python #LearnPython #Programming #Tech

To view or add a comment, sign in

Explore content categories