Interview Question

Data Science Interview

-Toronto, ON


Consider the following bit string 11?100 you need to write a method which can replace this question mark with 1 & 0 Output should be: 110100 , 111100 This should be implemented for N number of question mark each time replaced with 1 and then with 0


Interview Answers

2 Answers


Then u can iterate over the generator function

Anonymous on


def ques_remover(N): for e in range(N): if e%2 == 0: yield ‘110100’ else: yield ‘111100’

Anonymous on

Add Answers or Comments

To comment on this, Sign In or Sign Up.