Answer to Question #283361 in Python for Rdaf

Question #283361

You only like numbers that start with an odd digit. Anil gives you space-separated integers as input. Your task is to left - rote every number in the list (if required) so that it can be liked by you.





Note:





• If there is no odd digit in the number, do not rotate it.





• If a number starts with an odd digit, do not rotate it.

1
Expert's answer
2021-12-29T02:19:58-0500
def ​func1(list1):
   ​list2 = []
   ​for i in list1:
       ​j = str(i)
       ​if int(j[0]) % 2 == 0:
           ​for k in range(len(j)):
               ​j[k] = j[len[j]-k-1]
       ​list2.append(j)
   ​return list2
       ​
func1([12, ​252,2125])

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