Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to check if given number is binary in pytho

string = "101010000111"
p = set(string)

s = {'0', '1'}

if s == p or p == {'0'} or p == {'1'}:
    print("Yes")
else :
    print("No")
Comment

PREVIOUS NEXT
Code Example
Python :: dunder pyhton 
Python :: pandas dataframe delete column 
Python :: seaborn define linewidth 
Python :: video streaming flask 
Python :: how to make a sigmoid function in python 
Python :: how to use virtual environment python 
Python :: python calculate derivative of function 
Python :: how to display address in python 
Python :: df.select_dtypes 
Python :: blender python select object by name 
Python :: Python Crash Course, 2nd Edition: A Hands-On, Project-Based Introduction to Programming 
Python :: TypeError: exceptions must derive from BaseException 
Python :: python decimal string 
Python :: system to extract data from csv file in python 
Python :: if dict.values <= int 
Python :: append a zeros column numpy 
Python :: python pandas replace not working 
Python :: flask return error response 
Python :: create an array string using for in python 
Python :: How to Get the Difference Between Sets in Python 
Python :: pandas slicing from one column to another 
Python :: how to add an item to a list in python 
Python :: python append n numbers to list 
Python :: python moving average pandas 
Python :: date colomn to datetime 
Python :: python how to split a number 
Python :: view(-1) in pytorch 
Python :: fibonacci number in python 
Python :: hello world in python 
Python :: change python3 as default for mac 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =