A
A
Alexander Ivanov2020-08-27 14:07:03
Python
Alexander Ivanov, 2020-08-27 14:07:03

What should be the logic of selecting a number for uniqueness?

Help me figure it out. There is a first integer, and there are two lists of integers, you need to compare the first number with these two lists. Suddenly, if the first number is in one of these lists, then you need to add one to it and again go through these two lists. And so on until the first number is in any lists, then stop the whole process. I can not figure out how to do this, tell me, preferably with a ready-made code)))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-08-27
@alexivanov77

That is, while the number is in list1 or if the number is in list2, add one, otherwise stop?

while number in list1 or number in list2:
    number += 1
print('stop', number)

complex algorithmization, however

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question