Python Saved Program: quiescent-life

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


# Python program to display all the prime numbers within a given range

# Hello World program in Python
r,c = 3 ,3
a = []
for i in range(r):
    a.append([])
    for j in range(c):
            a[i].append(i+j)
a=[[0, 1,0], [1, 0,1],[1,0,1]]

for i in range(r):
    for j in range(c):
        
        a[i][j] = int(input("Enter array" ))

print("Before Cleaning ")
print(a)

for i in range(r):
    for j in range(c):
        if(a[i][j]==0):
            a[i][j]=1



print("After Cleaning ")
print(a)
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs