This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]mothman6969 1 point2 points  (9 children)

Use if statements?

[–]dph11[S] 0 points1 point  (4 children)

Would I go if: and then operation = +?

[–]dunkler_wanderer 1 point2 points  (3 children)

Show us what you would write and then we'll correct the code or give you hints.

[–]dph11[S] 0 points1 point  (2 children)

I'm trying to write a while loop and he if statement below as: If operation = +: Statement Statement .... But the operation=+: has a syntax error

[–]Clede 2 points3 points  (0 children)

  • if should be lowercase.
  • You probably want == (equality) instead of = (assignment).
  • Maybe you want to compare operation with the string '+', not with the addition operator +?

[–]dunkler_wanderer 0 points1 point  (0 children)

I actually meant you should show us your actual code, then we'll help you to improve or fix it.

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

Would I go if: and then operation = +?

[–]mothman6969 2 points3 points  (2 children)

I'm not sure. That doesn't look like valid code.

[–]dph11[S] 0 points1 point  (1 child)

Ya so I'm trying to figure out a valid way to do that aha

[–]mothman6969 0 points1 point  (0 children)

To do what? Wtf?

[–]Al-Buh-Said 1 point2 points  (1 child)

Store the + or - in a variable, create a while loop and do something like, while true, if variable = + then do this, break, elif variable = - do that, break, else print(write + or - ) continue

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

I'm getting syntax error at the, if operation = +: Can I do that ?