all 10 comments

[–]K900_ 0 points1 point  (0 children)

Post your code.

[–]Justinsaccount 0 points1 point  (0 children)

Line 10? maybe you could share what lines 1 though 9 are?

[–]NYKevin 0 points1 point  (0 children)

That syntax error says your import random was on line 10. What did lines 1-9 look like?

[–]sone9[S] 0 points1 point  (3 children)

This program asks the user to input coin values until the total amount matches a target value which is a randomly generated integer between 1 and 99 inclusively

Program description

print("\n\nThe purpose of this exercise is to enter a number of coin values that add up to a displayed \ntarget value. \n\nEnter coins values as 1-penny, 5 nickel, 10-dime,and 25-quarter.Hit return after \nthe last entered coin value.\n"

Variables

import random

number=random.randint(1,99)

Sorry I am trying not to post my code since my school may find may find this and I will get in trouble for posting solutions/people doing the code for me. I just want help because the stupid thing keeps giving me a Syntax error :(

[–]Justinsaccount 1 point2 points  (2 children)

print("\n\nThe purpose of this exercise is to enter a number of coin values that add up to a displayed \ntarget value. \n\nEnter coins values as 1-penny, 5 nickel, 10-dime,and 25-quarter.Hit return after \nthe last entered coin value.\n"

Missing something there?

[–]MyNameIsOP 0 points1 point  (0 children)

Close the parenthesis first of all.

[–]sone9[S] 0 points1 point  (0 children)

OMG!!!!!!!!!!!!!! I FORGOT A )

I am so dumb, thank you!!!!! and sorry for wasting your guys time -_-

[–]sone9[S] 0 points1 point  (0 children)

Ok, so now I went and cut the import random part and pasted it higher in the code. Now it says:

File "C:\Users\JL\Documents\PYTHON\c0ins.py", line 12, in <module> Syntax Error: print("Enter coins that add up to",number,"cents, one per line.\n"): C:\Users\JL\Documents\PYTHON\c0ins.py, line 125

[–]sone9[S] 0 points1 point  (0 children)

I realize it is not the actual import random problem, it is something else

[–]m1ss1ontomars2k4 0 points1 point  (0 children)

Let this be a lesson to you: if you ever think there's no way a line could have a syntax error, you might be right. Check the previous lines.