✅ Help with my program please!
Ok so for this program im making, I want the user to input a number (e.g. 15) and then the words fizz, buzz and fizzbuzz to be printed. The number inputted is what the program will go up to so if 15 was inputted then it would check numbers 1 to 15
Fizz for every number divisible by 3
Buzz for every number divisible by 5
And Fizzbuzz for every number divisible by 5 and 3
Then output on the last line of my code how many times it has said fizz, buzz, fizzbuzz and also how many numbers have been printed which arent divisible by 3 and 5.
however on the last line, every time i run the program all the numbers printed are the same e.g. 5,5,5,5
why? Help please!
13 Replies
Because you tried writing Python
AAAh
Braces are important
im too used to python
new to this!
Braceless statements only use the line that immediately follows
how would i use brackets here?
oh i see
so would i have both lines of each if statement in brackets?
So
is the same as
You need to put everything that's supposed to be handled by a given branch into the braces
oh my god it worked
So
thank
Anytime
!close
Closed!