Hello guys , today we will be making a random room chooser where you have to choose a room , and according to the room
you get a result. It's kind of like those game shows where you have to choose the right door or you lose. So , let's get started.
Now that we are done with the programming part , let's try and run it. Here , i will be choosing 5 rooms. Oops , looks like there is some mistake in the code. I will be choosing room number 1 and... looks like there was a shark in it.
Now , for the code. So first , we will get the input for how many rooms there should be. Then there is an array of possible outcomes from the rooms. Currently there is only four of them , but you can add as much as you like. Then we will create a empty list called rooms , and randomly add outcomes to it. Then we will take the guess and check if it is a good or bad room. Note here , if you want to add more possibilities then add check for the other outcomes in the if-else statement. No , if it is a good room then you win , else you lose. And if the room does not exist at all , you get a message saying it does not exists. So that's it for the code , as always the code will be linked in the description , bye.
Gist:
https://gist.github.com/sdcard2008/a0...
On this page of the site you can watch the video online Room Chooser Game Using Python with a duration of hours minute second in good quality, which was uploaded by the user SapDoesStuff 06 June 2022, share the link with friends and acquaintances, this video has already been watched 64 times on youtube and it was liked by 8 viewers. Enjoy your viewing!