Giraffe Academy is rebranding! I’ve decided to re-focus the brand of this channel to highlight myself as a developer and teacher! The newly minted Mike Dane channel will have all the same content, with more to come in the future!
Source Code –
This video is one in a series of videos where we’ll be looking at programming in python. The course is designed for new programmers, and will introduce common programming topics using the python language.
Throughout the course we’ll be looking at various topics including variables, lists, tuples, loops, conditionals, object orientation, and much more.
If you’re enjoying Giraffe Academy and want to invest in our future, consider leaving a contribution
Links:
Website –
Facebook –
Twitter –
Nguồn: https://rozanighani.com/
Xem thêm bài viết khác: https://rozanighani.com/game/
Hey Mike, I tried to build a simple quiz app with this method, but I failed. Please help me!!
Hi, Mike, your video is great, I want to randomize the questions along with answers and comments(if the answer selected is wrong, it will comment as 2 +2 =4 not 3 you choice. I got questions and answers correctly but the comments are not randomize with them correctly.
This code didn't work for me. I copied the whole thing down and it said this:
/usr/local/bin/python3.8 /Users/ryan/PycharmProjects/FreeTime/HowWellDoYouKnowMe.py
Traceback (most recent call last):
File "/Users/ryan/PycharmProjects/FreeTime/HowWellDoYouKnowMe.py", line 16, in <module>
Question(questionPrompts[1], 'B'),
IndexError: list index out of range
Process finished with exit code 1
Thanks you! So how do we use this as an desktop app? I want that users click onto this and play this quiz. How can I make that?
what good is a quiz if no one can take it? how do you put it on the internet without the answers showing in the code?
I got an error…
So I copied what he did exactly but when I run it it gives me an invalid syntax pointing to the 2nd question prompt I have and I can't figure out how to go past it
Hi Mike! Wonderful explanation! 6:55 At 18th line why do we just use question_prompt instead of dot. And what is meaning behind this dot. Please reply am just a beginner. Thanks in advance.
Hi. Your videos are a great help. I’m enjoying learning python. Do you have a video that shows how to export my quiz to a friend so they can play my quiz?
To the people who cannot import Question, then why not just create a Question class on top of the code. I know that this isn't a great way of doing it but it works for me.
No module named error what do now sir
wont ans = input(random.choice(question_prompts) just work? You just run if ans = a … elif ans = b … etc. etc.?
this is wy too simple just one problem tht if we want to generate questions at random then we have to make significnt chnges in the way we defined things cz i tried many things with this structure only if anybody can plz cmnt
This is perfect. Works great. Going to use this to analyse CSTA standards in my lessons. Hey, what software do you use to superimpose youself onto PyCharm screen? Thank you!!
Hi Mike. Thanks for your teaching! Which code editor are you using? The same function did not run in Atom editor…
I need to biuld a quiz that doesn't have right or wrong answers but rather different points acording to the answer that need to be summed at the end, How could I do that?
I am currently trying to do a who wants to be a millionaire game. I of course have to validate what the user inputs. He gets to choose from choices A, B, C, or D, how would I be able to validate this? I normally use the while loop, but I don’t want to do something like this: while answer!= “a” or answer!=“A” or answer!=“b” or answer!=“B”…….. how would I be able to validate this? I am very new to programming, so excuse me hahahaha
which version is it
How could I make the questions come out randomly. I've imported the random modue, but I'm not sure if you could do this in the class file or the exam file?
Great tutorial, but what gui are you using?
https://www.youtube.com/watch?v=-7jjo8UICjQ&t=1278s
you are the BEST python teacher EVER:)
Thank you soo much 🍎🍌🍓
I got the error : NameError: name 'score' is not defined
How to fix this?
Is this built for Python version 3.8 or 3.7?
How would you turn the questions into an android app and make a game out of it? Is that possible through Python?
How to use this in web page
your vidoe dosnt work idiot
mike you are like a brother to me
Here is my dressed up version of a quiz game. However, I didn't use def statements. If you run this program from OS, you will even see how the OS characters can change colour, and stay separate. Each letter can be a different colour if you like. But you must run the program by double clicking the file you made from here and that's how you can see what the actual, dressed up output looks like. Copy it and run it. Save it as whatever you wish. Double click to run it and see the features you can create. You must import OS, just as you can see here. The last input statement just stops the OS Python file from closing and disappearing, so you can see what happens. Press Enter and the program will close and vanish, until you re open/run it again.
import os
tc=(
'x1b[31m',
'x1b[32m',
'x1b[33m',
'x1b[34m',
'x1b[35m',
'x1b[36m',
'x1b[37m',
)
question_prompts1=(
f'{tc[2]}How many sides does a Triangle have?nn{tc[1]}(a) {tc[2]}four
sidesn{tc[1]}(b) {tc[2]}three sidesn{tc[1]}(c) {tc[2]}two sides',
f'{tc[2]}How many sides does a Square have?nn{tc[1]}(a) {tc[2]}
Two sidesn{tc[1]}(b) {tc[2]}Three sidesn{tc[1]}(c) {tc[2]}Four sides',
f'{tc[2]}How many sides does a Pentagon have?nn{tc[1]}(a) {tc[2]}
four sidesn{tc[1]}(b) {tc[2]}five sidesn{tc[1]}(c) {tc[2]}Three sides',
f'{tc[2]}How many sides does a Hexagon have?nn{tc[1]}(a) {tc[2]}six
sidesn{tc[1]}(b) {tc[2]}five sidesn{tc[1]}(c) {tc[2]}two sides',
f'{tc[2]}How many sides does a Octagon have?nn{tc[1]}(a) {tc[2]}four
sidesn{tc[1]}(b) {tc[2]}six sidesn{tc[1]}(c) {tc[2]}eight sides',
f'{tc[2]}How many sides does a Dodecagon have?nn{tc[1]}(a) {tc[2]}eight
sidesn{tc[1]}(b) {tc[2]}three sidesn{tc[1]}(c) {tc[2]}twelve sides',
f'{tc[2]}How many sides does a Hexadecagon have?nn{tc[1]}(a) {tc[2]}sixteen
sidesn{tc[1]}(b) {tc[2]}eight sidesn{tc[1]}(c) {tc[2]}six sides'
)
prompt=('b','c','b','a','c','c','a')
score=0
loop=0
while loop<=6:
os.system('cls')
button=input((tc[1])+'nKnow Your Stuff!nn'+(tc[2])+'Know Your Polygonsnn'+
question_prompts1[loop]+'nn'+(tc[0])+'READY:'+(tc[1])).strip()
if button==(prompt[loop]):
score+=1
loop+=1
os.system('cls')
print(f'n{tc[2]}Know Your Polygonsnn{tc[2]}You got {score}/{len(question_prompts1)}
questions correct.nCongratulations! Your total Prize Winnings: {tc[1]}${score*100*score:,}.00
{tc[2]}Dollars.nn{tc[0]}READY:')
input('nEND OF PROGRAM! Press Enter to quit.')