Jump to content

Variables not functioning as expected


Ramey

Recommended Posts

I took a Python coding course in college. Basic level, it taught me how to code short, basic programs.
This was six months ago.
I recently tried to pick coding back up, and decided my first project; a dice game I had an idea for a while back, as a computer program.
Problem: I've apparently forgotten how to do just about everything, because I can't even figure out why Pyzo (my program of choice for writing in Python) is throwing an error. All I want to do on the line in question is set a variable to 1. That's all. I've tried changing the variable name, tried putting it in all forms of quotation marks that I could think of. I even tried double equal signs.
But:
"dice1 = 1"
is absolutely against the law, and I can not understand why. I've tried google search. I've tried Youtube for basic learning videos on Python. I tried everywhere I could think of on w3schools. I even tried StackOverflow, but they're very professional, like actual software developers, and that... intimidates me. I'm simply trying to pick this back up as a hobby.

Link to comment
Share on other sites

I just tested this in the python compiler, below is valid python code.

dice1 = 123
print(dice1)

Outputs: 123

 

Is there a particular error which is showing up? Any other code you could provide?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...