Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax error
#1
Hi guys,

struggling to learn. Why is there a syntax error in the following:

Quote:combinations_amounts = []

for amount_100 in range (0, 100+1, 100):
[ind] for amount_50 in range (0, 100+1, 50):
[ind][ind] for amount_25 in range (0, 100+1, 25):
[ind][ind][ind] for amount_10 in range (0, 100+1, 10):
[ind][ind][ind][ind]for amount_5 in range (0, 100+1, 5):
[ind][ind][ind][ind][ind]for amount_1 in range (0, 100+1, 1):
[ind][ind][ind][ind][ind]total_so_far = amount_100 + amount_50 + amount_25 + amount_10 + amount_5 + amount_1

[ind][ind][ind][ind][ind]if total_so_far <= 100:
[ind][ind][ind][ind][ind][ind] combinations_amounts.append([amount_100, amount_50, amount_25, amount_10, amount_5 amount_1, 100 - total_so_far])
TEACH ME!!! By the way, I can't figure out how to show the indentations I have made in this post so I made these clumsy [ind], I hope you understand. I believe the indentation is correct, but who knows. maybe you?

Thanks and very much appreciated
Reply


Messages In This Thread
Syntax error - by Blaedel - Aug-03-2020, 12:46 PM
RE: Syntax error - by DeaD_EyE - Aug-03-2020, 01:15 PM
RE: Syntax error - by Yoriz - Aug-03-2020, 01:17 PM
RE: Syntax error - by Blaedel - Aug-03-2020, 01:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  POST Syntax error amplay 0 655 Aug-07-2024, 02:43 PM
Last Post: amplay
  is this really a syntax error? Skaperen 4 1,630 May-25-2024, 07:31 AM
Last Post: snippsat
  World Clock syntax error OscarBoots 1 1,119 May-03-2024, 05:20 AM
Last Post: snippsat
  Syntax error for "root = Tk()" dlwaddel 15 6,527 Jan-29-2024, 12:07 AM
Last Post: dlwaddel
Photo SYNTAX ERROR Yannko 3 1,326 Jan-19-2024, 01:20 PM
Last Post: rob101
  Syntax error while executing the Python code in Linux DivAsh 8 5,014 Jul-19-2023, 06:27 PM
Last Post: Lahearle
  Code is returning the incorrect values. syntax error 007sonic 6 3,029 Jun-19-2023, 03:35 AM
Last Post: 007sonic
  syntax error question - string mgallotti 5 2,667 Feb-03-2023, 05:10 PM
Last Post: mgallotti
  Syntax error? I don't see it KenHorse 4 2,771 Jan-15-2023, 07:49 PM
Last Post: Gribouillis
  Syntax error tibbj001 2 1,850 Dec-05-2022, 06:38 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020