Hi, @terasolver98951 ,
Because the code that you posted is not formatted, it is difficult for other users to read and debug it. After code has been pasted into the editing window for posting, you can format it by selecting it, and then by clicking the </> button above the editing area. Alternatively, you can place three backquotes on the line before the code and three backquotes on the line after the code. This will enable us to see important details, such as the indentation and underscores. If you use the backquotes, your code will be color-coded, making it especially easy to read.
Question 1: what does it mean when I initialize the the count variable by assigning it with a value zero?
Before you start counting occurrences of
"fizz" within the loop, your actual count is
0, so you set
0 prior to the loop.
Q2: then what does incrementing the total mean? i.e. count = count + 1?
Whenever you find an occurrence of
count needs to be increased by
1, and that statement implements that increase.