+ 2

WAP in which you have to find the missing number in an array of 1-100?

18th Jan 2017, 3:51 PM
sid
3 Respostas
+ 10
# if you have list a = [1, 2, ... 100] then: if x in set(a): print('yes') # x in 1-100 else: print('no') # x there isn't n 1-100
19th Jan 2017, 8:12 AM
Sergey
+ 9
array? There is list, set, dict, tuple in Python. No array.
19th Jan 2017, 8:06 AM
Sergey
+ 2
# given: list A is the array with the missing number missing _ number = sum(range(101))-sum(A) this works if there is only one missing number. see my code as example.
19th Jan 2017, 11:43 AM
CodingForFun
CodingForFun - avatar