Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I want to print numbers from 1 to 100, but for multiples of 3 I want to print "Fast" ,for multiples of 7 I want to print "Car" and for multiples of both 3 & 7 I want to print "Fast Car" instead of that number. Here I'm trying to implement it using Python. This is my 1st program in Python. Here I'm getting syntax error. Can any one help me with this??

for num in range(1,100)
        if num%3==0 & num%7==0
             print "Fast Car"
        elif num%3==0
             print"Fast"
        elif num%7==0
             print "Car"
        else
             print num
share|improve this question
2  
First, a more common naming of this is "FizzBuzz". Second, we're only doing review of code (as the name suggests), if you've got a problem with your code, go to Stack Overflow. –  Bobby Dec 28 '11 at 9:41
    
As Bobby said, this site is for getting reviews of working code. It is not an alternative Stack Overflow for people who've been banned from asking questions on the real Stack Overflow. –  sepp2k Dec 28 '11 at 14:15
add comment

closed as off topic by sepp2k Dec 28 '11 at 14:09

Questions on Code Review Stack Exchange are expected to relate to code review request within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

You are missing ":" at the end of lines 1, 2, 4, 6, 8.

Moreover (but it's not a syntax error), you have a too big indentations on lines 2..9 (8 spaces instead of 4). Use pep8!

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.