Question: Python - Strings . System generates a string . The program will check for odd numbers from the list and double them and print entire

Python - Strings . System generates a string . The program will check for odd numbers from the list and double them and print entire list.
Example 1
Enter a seed 31
Output => First the list and then double odd numbers only
[15,3,12]
[30,6,12]
I did code but its doubling all the list including even
=========================================
s = int(input("Enter a seed "))
y = getList(s)
z = len(y)
print (str(y))
count=0
while count < z:
if y[(z-1)%2!=0]:
y[count]= y[count]*2
count+=1
#print (str(y))
else:
y[count]= y[count]
print(str(y))
My output is doubling all list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!