I really, really want to give you all a big thank you, especially to users: JaMiT, Mike and Yksisarvinen for helping me out with this.
As you three pointed out that you all don't seem to be facing issues with the code I got confused till I read user Yksisarvinen's response which made me think of trying a different online compiler and viola-- my code works just fine (except when I end up guessing correctly it doesn't give me the victory text but I'll fix it)! I'm sorry if I wasted anyone's time with such a stupid problem but I was really stressing out over this-- so it does truly mean a lot to me that you all tried to help me out. Thank you (and sorry).