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...
На этой странице сайта вы можете посмотреть видео онлайн Room Chooser Game Using Python длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь SapDoesStuff 06 Июнь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 64 раз и оно понравилось 8 зрителям. Приятного просмотра!