Answer to Question #195929 in Python for reeeg

Question #195929

Please help me rearrange this code again and please correct it. I can't run it. Thank you!

n = int(input())


for i in range(n):

  1st = list(map(int,input().split()))

  lst1 = lst[1:]


  elem = lst1[0]

  counter = 1


for j in range (1,len(lst1)):


  if 2*elem > lst1[j]:

    counter = 0

    break

  elem = lst1[j]


  if counter == 1:

    print("Denominations: " lst1)

    print("Good coin denominations !")

    else:

      print("Denominations: " lst1)

      print("Bad coin denominations !")



1
Expert's answer
2021-05-20T11:01:10-0400
n = int(input())
for i in range(n):
  lst = list(map(int,input().split()))
  lst1 = lst[1:]
  elem = lst1[0]
  counter= 1

for j in range (1,len(lst1)):
  if 2*elem > lst1[j]:
    counter = 0
    break
  elem = lst1[j]

  if(counter == 1):
    print("Denominations: ",lst1)
    print("Good coin denominations !")
  else:
      print("Denominations: ",lst1)
      print("Bad coin denominations !")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS