99.6k views
0 votes
X= [12,67,89,34,56,90,67]

Write a python program to bring the following output by using the given X.

Output:

[12,67,89,34,100,56,90,67]



1 Answer

6 votes

Answer:

X = [12, 67, 89, 34, 56, 90, 67]

for i in range (len(X)):

if (X[i] == 34):

print(X[i])

print("100")

else:

print(X[i])

Step-by-step explanation:

Kind of a ugly hack because I'm not all too familiar with python, but it gets the job done :^)

User MatthewJ
by
6.1k points