Untitled

mail@pastecode.io avatar
unknown
python
7 months ago
428 B
2
Indexable
Never
def test_new_number(test_number):
    try:
        test_number_int = int(test_number[:2]) + 1
        if test_number_int < 10:
            new_number = f'0{test_number_int}00000001'
        else:
            new_number = f'{test_number_int}00000001'
        return new_number
    except ValueError:
        return "Invalid input"

test_number = '02026843'
new_number = test_new_number(test_number)
print(new_number)