You have just saved me from failing my Coding homework :)
@shojauddin25093 жыл бұрын
you could use arrays
@jackyhao4704 жыл бұрын
very useful helped me cheat on my homework =)
@GeekTutorials14 жыл бұрын
That's what I'm here for!
@outlandishdude18323 жыл бұрын
Hello sir...can you provide me the flowchart for this program 🙏
@Moonsong02 Жыл бұрын
great tutorial!
@GeekTutorials1 Жыл бұрын
Thanks!
@bitchpudding29453 жыл бұрын
You should’ve added a second question... it gives you and answer for the first question, but it gives you a syntax error message when you type in the second question for some reason
@GeekTutorials13 жыл бұрын
Talk to me, Bitch Pudding. What's the error say exactly? We can fix it! Relax
@bitchpudding29453 жыл бұрын
@@GeekTutorials1 Literally syntax error I copied everything to last T, and my first question gave me a response. Then I remeber typing in "Will I grow bald", and the program highlighted the "I" and said syntax error
@bitchpudding29453 жыл бұрын
import random ans1 = "It is certain" ans2 = "It is decidedly so" ans3 = "Without a doubt" ans4 = "Yes - definitely" ans5 = "You may rely on it" ans6 = "As I see it, yes" ans7 = "Most likely" ans8 = "Outlook good" ans9 = "Yes" ans10 = "Signs point to yes" ans11 = "Reply hazy, try again" ans12 = "Ask again, later" ans13 = "Better not tell you now" ans14 = "Cannot predict now" ans15 = "Concentrate and ask again" ans16 = "Don't count on it" ans17 = "My reply is no" ans18 = "My sources say no" ans19 = "Outlook not so good" ans20 = "Very doubtful" name = input("Enter your name: ") input(name + ", What is your question for the Magic 8 Ball? ") choice = random.randint(1,20) if choice == 1: answer = ans1 elif choice == 2: answer = ans2 elif choice == 3: answer = ans3 elif choice == 4: answer = ans4 elif choice == 5: answer = ans5 elif choice == 6: answer = ans6 elif choice == 7: answer = ans7 elif choice == 8: answer = ans8 elif choice == 9: answer = ans9 elif choice == 10: answer = ans10 elif choice == 11: answer = ans11 elif choice == 12: answer = ans12 elif choice == 13: answer = ans13 elif choice == 14: answer = ans14 elif choice == 15: answer = ans15 elif choice == 16: answer = ans16 elif choice == 17: answer = ans17 answer = ans18 elif choice == 19: answer = ans19 else: answer = ans20 print("Magic 8 Ball: ", answer)
@GeekTutorials13 жыл бұрын
@@bitchpudding2945 Copy and paste the error here. It will tell you what line the error is on and what might be causing the issue.
@bitchpudding29453 жыл бұрын
@@GeekTutorials1 Will I eat cake? SyntaxError: invalid syntax
@pietraolegal4 жыл бұрын
How to make it repeat the first process? Then i dont need to open the file all the time i want to test it
@GeekTutorials14 жыл бұрын
You'll need to use an endless loop for the main part of the code. To do this, you use the "While True" statement. You'll have to do some research on this.
@pietraolegal4 жыл бұрын
@@GeekTutorials1 thanks
@bitchpudding29453 жыл бұрын
Somehow I did all of that but when I tried to run it, I got a syntax error... dislike
@GeekTutorials13 жыл бұрын
Hey Bitch - what's the error say? Syntax errors are easy to get rid of.
@srenjensen38174 жыл бұрын
how about: 'import 8_ball' ?
@Mujiboy3 жыл бұрын
That doesn't work with python idle XD
@distant66063 жыл бұрын
i mean you could have made it faster with random.choice or randint with the questions in a list
@levchegochev60865 жыл бұрын
Its not working
@GeekTutorials15 жыл бұрын
It does work. You will need to thoroughly check your code for where the issue could be. What's the error message you get?
@levchegochev60865 жыл бұрын
@@GeekTutorials1 I don`t get an error ,it asks my name then whats my question for the 8 ball and then nothing happens
@GeekTutorials15 жыл бұрын
@@levchegochev6086 Interesting. There would be something missing from your code, but I'm not sure what exactly. I've completed this tutorial with many students and it works every time. I hope you find the issue.
@levchegochev60865 жыл бұрын
Geek Tutorials I copy all your code don’t know what’s the problem :/
@xwizdom96275 жыл бұрын
are you using python 3?
@brokenblade59922 жыл бұрын
Don’t try it with replit
@anthonyhicks69504 жыл бұрын
is it just me or does he sound like jason statham
@GeekTutorials14 жыл бұрын
If only I looked like him too!
@iharvxyi66014 жыл бұрын
Teacher told me to like so I did opposite
@GeekTutorials14 жыл бұрын
Cheers, mate. You going this page is enough to keep the view count going up and the money rolling in.