Login with Hive Keychain
Enter your Hive username to sign in securely.
Welcome to HiveComb
HiveComb runs on Hive — an open, decentralized blockchain where your posts, votes, and communities belong to you, not a company. To get started, follow these steps:
Create a Hive account
Set up your free account — it only takes a minute.
Install Hive Keychain
A browser extension that securely signs your transactions — your keys never leave your device.
Refresh & log in
Once Keychain is installed, refresh this page and click Login again.
Need help? Join our Discord and we'll help you get set up.
No account? Create one
Having trouble creating your account? Come to our Discord and we'll get you set up.
No posts found
Try adjusting your filters or wait for the worker to classify more posts.
No posts found
Try adjusting your filters or wait for the worker to classify more posts.
No posts found
Try adjusting your filters or wait for the worker to classify more posts.
Welcome to HiveComb!
Choose your default filters to see the content you care about most.
Languages
Categories
Sentiment
DIY:Programming Tutorials EP07 - Creating a Quiz game in Python.
Greetings to all;
Congratulations to you, if you’ve found yourslef on my blog you are in to gain lots of cool and fun stuffs :) that might come in handy, welcome once again to another edition of my coding tutorials. For todays edition, i thought of creating a fun quiz using python. The question’s and answers are programmed into the computer, so basically the person taking the quiz needs to tru and get the answers right. They would be based on hive and mainly on this community. I’ll show you how its done. At your own pase you can try it out. You can even go ahead and customize it with your own questions.
To start the quiz, there is need to you welcome the audience or peoples going to participate in the quiz, so i start by using the print function to print the phrase “Welcome to HIVE Quiz”. And then i went on to ask the user if he or she has the intention of playing. This is accomplished by using a funtion playing which is set to input(“Are you interested in palying “). This space given betwen the playing and “ will allow the user enter his input as wether yes or no.
Now i will use the IF clause such that when a user enters yes, he can continue to play the quiz game and if he enters no, the code is terminated. So if playing is not equal to yes, in programming not equal to can written as !=. Then quit(). This would end the code if the input is not yes.
Lets print “lets play” if the users enters yes. Mind you if you enter no, the code will be terminated and you will not see the ”lets play” being displayed by the computer.
Output of the code;
Output if no was inputed;
For the first question, i asked ”what does DIY mean? “. I hope you understand why i have left a space the ? and the “.? This is to allow the user enter his answer.
Now its time to feed the computer with the answer to the question. We will be using the IF CLAUSE so that if question = ”DO IT YOURSELF tell the user he is correct. so now the computer knows the answer as DO IT YOURSELF. so if the user types exactly the same thing the prompt will be Correct. if you mix caps with small letters it will wont work because python programming language is case sensitive.
We bring in the Else stament so that if anything apart from the amswer provided is inputed by the user it should tell him Incorrect
For the second question, all we need to do is to repeat all what we did for the first question. But the questions needs to change this time around the qestion would be what is Diyhub about?.
We again use the if clause to feed the answer to the computer such that if question = all about do it yourself print correct, else print incorrect.
The third question, following the same procedure but changing the previous question we have How many categories of post does Diyhub discover?.
Using the if clause, if question = 3 then print correct if not using the else function print incorrect.
For the final and last question, we will be required to name the categories of post they discover. The two statements if and else clause are used simultaneously to accomplish that. The if will feed the computer with the amswer creative, crafting, home and gardening
Whiles the else stament will tell the user he is incorrect if any input apart from that list is entered.
Now we run entire code;
Now lets try an output code where i enter no;
Well that will be all. And thank you for stopping by see you all on the next on. If you have any questions feel fry to ask i will reply you as soon as possible. Thank you
Report Misclassification
Why is this post incorrectly classified?
Comments
10 commentsGreat tutorials from you, I really wanted to learn programming skills I think I would keep following your posts to learn something from you.
Yeah you can. I have dropped some tutorials already you can look them up.
I’ve always been interest in learning programming. This is good and easy to understand. Maybe you should be teaching me in person man.😂
Yeah bro anytime you can come in for lessons at a fee tho😂
And me too please🤗 cool to have a programmer on our midst.
So the questions are about DIY! Nice. Well done.
Yes🤗. Thank you for your support.
Yay! 🤗
Your content has been boosted with Ecency Points, by @jimah1k.
Use Ecency daily to boost your growth on platform!
Support Ecency
Vote for new Proposal
Delegate HP and earn more
Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!
Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).
You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.
Thank you.