Answer to Question #264604 in Python for swsq

Question #264604

Given a list, add 1 if the given number in the list is even and add 2 if the given number is odd in a given string


1
Expert's answer
2021-11-17T13:24:33-0500
input1 = int(input('Enter string here: '))
if input1 % 2 == 0:
    print(input1+1)
else:
    print(input1+2)

Enter string here: 7
9

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS