Re my program below, I am having difficulty to:
i) ask user if he wants to play again or not after every time he guesses right.
ii) code a counter that controls and update loser how many tries he has left.
I have somewhat code something close to that but mine only worked out per run. I do not want that ... i need it to run until all three sessions are reached
I would do this in such a way where you have all in for loop
I think your problem is on line 24 - you ask user to input number but only once, whereas this line should be repeated 3 times (as far as I understand your code)
same for test if the number entered is correct, all should be inside the loop.
What you do in line 38-40 is to create a loop that loops over 3 times, but only 1 entry was provided.
Think like compiler, you are going from top to bottom.
So first you set your variables,
then question do you want to continue or quit (this could be while loop == true)
then user input number (once only as there is NO loop there) and number is check if is true or false.
then Loop kicks in and display 3 messages, where it only have informations about 1st.