Python standard library: built-in functions bin (x), pythonbin

Source: Internet
Author: User

Python standard library: built-in functions bin (x), pythonbin

Converts x to a binary string. If the x parameter is not an integer object, you can use the _ index _ () function to return an integer.

Example:

# Bin (x) print ('100: ', bin (100), '64:', bin (64 ))

The output result is as follows:

100: 0b1100100 64: 0b000000

Cai junsheng QQ: 9073204 Shenzhen

Tutorial: when I read a python code, I saw the introduced module PySTAF, but I checked the python standard library and didn't find this module.

This is an automated test module that can be downloaded from sourceforge.
Staf.sourceforge.net/current/STAFPython.htm

How to view built-in functions in python

Import sys
Print dir (sys. modules ['_ builtin _'])

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.