Question: Write a PYTHON program that inputs a string that represents a binary number. The string can contain only 0s and 1s and no other characters,

Write a PYTHON program that inputs a string that represents a binary number. The string can contain only 0s and 1s and no other characters, not even spaces. Validate that the entered number meets these requirements. If it does not , display an error message. If it is a valid binary number, determine the number of 1s that it contains. If it is two 1s, display "accepted". otherwise, display "rejected". All inputs and outputs should be from the console. using Python 3.5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!