## Creating multiple choice Q&A

This is the place for queries that don't fit in any of the other categories.

### Creating multiple choice Q&A

I'm new to python and my teacher gave me a assignment on making a multi choice question/answer program. I was wanting it to look like this and this assignment is due next week, I do not know anything about python and was wondering if you guys could help me i'm stressing a lot because I don't know how to do this and my teacher is no help.

Example
1. Quit
2. Division
3. Multiplication
4. Mixed

If 1, 2 or 3 is chosen it will look like this.
e.g. ‘2’ has been chosen

10÷2=?
A) 5
B) 9
C) 3
D) 2
If answered wrong it will give you another question all randomized so the person would not be able to cheat and It would ask 10 questions after those 10 questions are done it will tell you the total score you have got! (out of 10)
ahmedruler1

Posts: 7
Joined: Tue Jun 25, 2013 6:29 am

### Re: Creating multiple choice Q&A

Sorry, I don't think anyone will do your work for you.
But if you give it a try and ask specific questions, yuo should get help in no time.

If you really haven't heen taught any python(which is unlikely), going trough any basic tutorial should get you enough knowledge to do this, or at least get started.
Friendship is magic!

R.I.P. Tracy M. You will be missed.

stranac

Posts: 1475
Joined: Thu Feb 07, 2013 3:42 pm

### Re: Creating multiple choice Q&A

stranac wrote:Sorry, I don't think anyone will do your work for you.
But if you give it a try and ask specific questions, yuo should get help in no time.

If you really haven't heen taught any python(which is unlikely), going trough any basic tutorial should get you enough knowledge to do this, or at least get started.

I understand that I've been taught a bit and I have some coding of what I've got so far I'd love to show you or if you wouldn't mind? Would you be able to tell me what i'd be able to do to make it look likethe example I posted?
ahmedruler1

Posts: 7
Joined: Tue Jun 25, 2013 6:29 am

### Re: Creating multiple choice Q&A

Don't post again without reading this. You should have posted your code, its output, and what needs to change in your original post instead of just your assignment.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.

micseydel

Posts: 1927
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

### Creating multiple choice Q&A [UPDATED]

I'm new to python and my teacher gave me a assignment on making a multi choice question/answer program. I was wanting it to look like this and this assignment is due next week, I do not know anything about python and was wondering if you guys could help me i'm stressing a lot because I don't know how to do this and my teacher is no help.

Example
1. Quit
2. Division
3. Multiplication
4. Mixed

If 1, 2 or 3 is chosen it will look like this.
e.g. ‘2’ has been chosen

10÷2=?
A) 5
B) 9
C) 3
D) 2
If answered wrong it will give you another question all randomized so the person would not be able to cheat and It would ask 10 questions after those 10 questions are done it will tell you the total score you have got! (out of 10)

Code: Select all
`#year 11 programming assesment#prototype  of assignment#program to help others (division) Multi choice #Made by Ahmed Ibrahim#Created Mid June#Declare/initialise variablesimport random import syssVal = "" iDivide = 0sName = ""sMessage="" #Message for user (string)sMenuChoice = "0"while sName is "":    sName = input ("Please enter your name: ")    if sName is "":        print  ("Error: Please tell me your name!")    sMessage = "Hello " + sName + " are you ready to get started? " + (sMessage)print (sMessage) #define divide def APDivide ():    sDivideChoice = "0" while not sDivideChoice == "3":        #AP menudef APMenu ():    while not sMenuChoice == "3":        sMenuChoice = str(input("\n\tPress \n\t(1) To exit out of the program \n\t(2) Division \n\t(3) multiplication  : "))                if sMenuChoice == "1":            sys.exit()                               if sMenuChoice == "2":            APDivide()                                if sMenuChoice == "3":            APMultiply()            #Give User menu of choicewhile not sMenuChoice == "3":    sMenuChoice = str(input("\n\tPress \n\t(1) To exit out of the program \n\t(2) Division \n\t(3) multiplication  : "))        if sMenuChoice == "1":        sys.exit()        print ("error cannot quit please use command 'terminate' to force close")            if sMenuChoice == "2":        APDivide()            if sMenuChoice == "3":        APMultiply()        `

This is what I have done so far.
ahmedruler1

Posts: 7
Joined: Tue Jun 25, 2013 6:29 am

### Re: Creating multiple choice Q&A

Did you have a question about your code? It has blatant errors, but I'm not sure what you want from us.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.

micseydel

Posts: 1927
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

### Re: Creating multiple choice Q&A

I will show you a some tricks and some code. Remember google is your friend
(And the othe people is right, this is not a place where you can drop off your homework )

Start by planning your program on a paper. The program should consist of 2 things: Menu and Engine

Code: Select all
`print(" made by: \n --------------------") # \n basicly mean: creat a new lineprint("1 - quit")print("2 - Multiplication") # note that it only has multiplication, because it is a example!while 1:    choose=input("please write:")    if choose=="1":        break # we basicly break the while loop so it stops    if choose=="2":        print("lol")    else:        print("i be a stupid program, me not understand what u say!")`

now let's make the hard part:

Code: Select all
`import randoma=int(random.random()*55444)b=int(random.random()*55444)print("What is: "+str(a)+"*"+str(b)+" equal to?")`

now i cannot help you anymore, maybe you should make a more simpler program you know you can do and then extend it alittle by the hour while learning 8:
- VrKiller

vrkiller

Posts: 19
Joined: Fri Jun 28, 2013 10:50 am
Location: Denmark, århus

### Re: Creating multiple choice Q&A

vrkiller wrote:I will show you a some tricks and some code. Remember google is your friend
(And the othe people is right, this is not a place where you can drop off your homework )

Start by planning your program on a paper. The program should consist of 2 things: Menu and Engine

Code: Select all
`print(" made by: \n --------------------") # \n basicly mean: creat a new lineprint("1 - quit")print("2 - Multiplication") # note that it only has multiplication, because it is a example!while 1:    choose=input("please write:")    if choose=="1":        break # we basicly break the while loop so it stops    if choose=="2":        print("lol")    else:        print("i be a stupid program, me not understand what u say!")`

now let's make the hard part:

Code: Select all
`import randoma=int(random.random()*55444)b=int(random.random()*55444)print("What is: "+str(a)+"*"+str(b)+" equal to?")`

now i cannot help you anymore, maybe you should make a more simpler program you know you can do and then extend it alittle by the hour while learning 8:

Omg Thanks a lot this is what I needed to start and Now I think I can finish this easily thanks a lot!
ahmedruler1

Posts: 7
Joined: Tue Jun 25, 2013 6:29 am