Introduction to Objects in Python: Magic 8-Ball

preview_player
Показать описание
This 36-minute video demonstrates the development of a program that simulates a Magic 8-Ball. The last half of the video includes an introduction to object-oriented programming concepts.
Рекомендации по теме
Комментарии
Автор

This is one of the best programming tutorials I've seen recently. Actually, it's so good that I (re)wrote the Magic 8 Ball in C++ for fun, as I don't do Python, but after this video I'm definitely going to give it a try. Thanks for this great video! Keep up the good stuff coming!

MrKurrak
Автор

You're an excellent teacher. I believe that because you teach 'by example' and test it in the presence of all who are viewing.
Thank you for your efforts.

SmokeFlame
Автор

Very useful, Looking forward for more tutorials, thank you

yassernaggar
Автор

This was a pretty cool little idea for a project. Fun stuff :)

Vejinx
Автор

awsome...oop simplified..can't wait to see your other tutorials..thanks mann..

derrick
Автор

This is a great video for someone like me who is just beginning to learn python (and programming). I always wondered what is the need for a 'class' and a 'function' when you could just write code that works without them. And the way you wrote the code using standards, very much impressed. Kudos to you! Great job and Thank you! Hoping to see more videos from you :) Would it be possible to cover following topics in your future sessions?
1. What is the significance of __init__ (and double underscores)?
2. Exceptions and errors.
3. Starting point (or modules) for test driven designs? May be with some quick examples.

priyankrc
Автор

Great videos, Richard, you should do more!!!!

oscarmartinezbeltran
Автор

Great explanation. I needed such a thing desperately. Thanks a ton!!

nikhildhamija
Автор

Thanks this is very helpful, and straight to the point!

metroid
Автор

Have you any python training course for beginner from basic to advance. Your teaching way is really good, but there are not much videos in your channel regarding teaching python.

LamNguyen-uicf
Автор

The Magic 8 Ball is shaken twice for the first question (v3)?

SHONNER
Автор

Hi Richard, you have a great way to explain these things. I learn so much from you. Thanks!
However, as a complete beginner to programming, I don't understand what is this (if __name__=="__main__":) for., instead of just main(). Thanks!

nunnonugroho
Автор

hello, first thank you a lot for the videos, very useful, great work, i have a question about def main() if __name__=="__main__": main why we should use it, and why many times i cant use it, i get indentation error?

mensiuscho
Автор

Is it better to be running python 2 or python 3 in 2016. (You've probably been asked this question before..)

chriskarani
Автор

Hmm why not random.randint(1, 3) instead?
Watched a bit further, you've changed it a bit so it makes more sense now.

olegvin
Автор

I got the following error even if i used the same code. I use python python2.7.14

Magic 8 ball predicts the future
enter the question: Will i be good today?

Traceback (most recent call last):
File "C:\Users\SHAITANIROOH\Desktop\8_ball_v1.py", line 9, in <module>
main()
File "C:\Users\SHAITANIROOH\Desktop\8_ball_v1.py", line 5, in main
question = input("enter the question: ")
File "<string>", line 1
Will i be good today?
^
SyntaxError: invalid syntax

maxfarasat
Автор

Why didn't you just use random.randint(0, 3)

Thank you for the informative video!

TheSkepticSkwerl
Автор

import random

antwoorden = [ "Het is zeker", "Het is beslist zo", "Zonder twijfel", "Zeer zeker", "Je kunt erop vertrouwen", "Volgens mij wel", "Zeer waarschijnlijk", "Goed vooruitzicht", "Ja", "Tekenen wijzen op ja", "Reactie wazig", "probeer later opnieuw", "Vraag later opnieuw", "Beter je nu niet te zeggen", "Niet te voorspellen", "Concentreer je en vraag opnieuw", "Reken er niet op", "mijn antwoord is nee", "Mijn bronnen zeggen nee", "Vooruitzicht niet zo goed", "zeer twijfelachtig" ]

antwoord = random.choice(antwoorden)

naam = input("wat is je naam? ")
naam
print(naam)
vraag = input(f"{naam.capitalize()}, wat is je ja of nee vraag voor de Magic 8 Ball? ")

print(antwoord)

paraglide
Автор

Excelent content, and video, but this keyboard on

ygorgomes
Автор

Hi Richard, the 106 should be 2016, you have been told, your welcome.

paraglide