So, I want the odd numbers of the list to be multiplied by two and form a new list with the same index value but no other changes in the initial list, for example i is the initial list and o is the output i want
i=['0','7','2','3','4']
o=['0','14','2,'6','4']
here's the code I tried:
list=["1","3","7"]
for num in list:
if num%2!=0:
num*2
print(list)
here's the error I get:
PS C:\Users\suhas\Desktop\sujan> & C:/Users/suhas/AppData/Local/Programs/Python/Python39/python.exe c:/Users/suhas/Desktop/sujan/user_testing.py
Traceback (most recent call last):
File "c:\Users\suhas\Desktop\sujan\user_testing.py", line 5, in <module>
if num%2!=0:
TypeError: not all arguments converted during string formatting