Logo
  • Home
  • Links
  • git
  • python
  • sql
  • About
  • Contact

Logo
Links
git
python
sql
🌞 🌒

Getallen omzetten naar binair met bin()

2022-06-06
Kees de Keijzer

Op deze pagina:

    De functie bin(x) geeft een string die de binaire waarde voorstelt van de integer x.

    
    >>> bin(7)
    '0b111'
    
    >>> bin(-7)
    '-0b111'
    
    >>> bin(7.7)
    Traceback (most recent call last):
      File "", line 1, in
    TypeError: 'float' object cannot be interpreted as an integer
    
    >>> bin(int(7.7))
    '0b111'
    

     

    Verwante artikelen

    • Een shell opdracht uitvoeren met Python
    • Python enums
    • SQLite en Python
    • Python Tuples
    • if elif else
    ×

    Tag cloud

    pythonpyqtsqlpyqt5gitpostgresqlcommitpainterdropdirectorycolorbestandpyqt4pushbuttonlineeditcreateaddvenvvariableunicodestringsqlitesqlalchemyselectradiobuttonordjoininputfunctiedjangocommentaarchrcheckboxcasebackupalterxmlwindowwidgetvirtualviewvacuumuvuserurllibupdateuniontypetupletruncate


    RSS feed    About    Contact

    Have a nice day!

    © 2025 kazilla.nl

    Deel op Mastodon