hi,
actually i am confused with if/else statement
i don’t know when and where we should use them can you explain it more briefly
and after writing
while(cokeleft > 0){
print(“you have (cokeleft) cokeleft.”)
why does it showing 5 cokeleft
i am learning programming for first time,i hope u understood my problem
In the string, you are directly referencing the variable cokeLeft by the following text: (cokeLeft).
Anything you put inside of () will be converted into a string. Try it yourself. Create a new variable and place it in a string using () so you can see the results.
If you have any other questions, feel free to shoot me an message.
Thanks. Love the tutorial. I am having lots of fun learning.
one of the lines in the “Break” from loop tutorial is out of place
the line: cokesLeft = cokesLeft -1
this line should be written after the “if” conditional.
as it is written now, there will be 5 cokes left and 4 fantas at end of program.
if this line is moved to after the if conditional then they will be even at 4