Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 12 Online
OpenStudy (anonymous):

I have a syntax error http://pastebin.com/KVVwk6sa

OpenStudy (anonymous):

Try removing the ' '. The syntax is for char in x: if char == symbol. By the way, the assignment is also without quotes, and you don't need to create another variable for that. for char in string: if char == symbol: count += 1

OpenStudy (anonymous):

This would be more simple though: http://pastebin.com/KtJifWD9

OpenStudy (anonymous):

x and 'x' are vastly different things. x is a variable that can point to anything. 'x' is a string with a single lowercase X in it. Same for symbol and 'symbol'. One is a variable, the other is a string with 6 characters in it.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!