showing indentation erroe in line 9

0 votes
asked Jun 4 by Shubham Yadav (180 points)
import numpy as np
ar1=[20,30,50]
ar2=[60,40,25]
arr2 = np.ar([60,40,25])
temp=[]
temp2=[]
for element in arr2:
    for i in range(3):
        if ar[i]>element:
            count=count+1
            temp=a[i]
            temp2=element

print(count)

1 Answer

+1 vote
answered Jun 6 by xDELLx (3,580 points)
edited Jun 6 by xDELLx

On Line "  if ar[i]>element: " the array "ar" is never created as a variable ,hence the error.

Also " count=count+1" will generate error as variable count not defined

finally, " temp=a[i]" will be an error ,you can figure this one cheeky

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...