Question: Hello, I have a python lab that I need help with: For this lab, you are to: Write a python script that runs over http.

Hello, I have a python lab that I need help with:

For this lab, you are to:

  • Write a python script that runs over http. You may NOT use a separate html file for this lab.
  • Generate a form in a function that asks for 2 numbers and has 4 different submits. The submits will be labeled: Add, Subtract, Multiple and Divide.
  • If 'Add' is selected, only the sum of the two fields will be neatly output.
  • If 'Subtract' is selected, only the difference of the two fields will be neatly output.
  • If 'Multiply' is selected, only the product of the two fields will be neatly output.
  • If 'Divide' is selected, only the division result of the two fields will be neatly output.
  • All the numbers input and output are real numbers treated as floating point.
  • Choosing good labels and variables names is important.
  • You'll need to submit a link to the script that generates the form.

Possible order to do things.

  • Get a form inside a python script running.
  • Change the
    to two number and 4 submit buttons.
  • Build an 'if-elif' structure in python that 'says' what submit button was pressed.
  • Work on 'add' ... you'll need to convert the input to integers (all web input is strings)
  • Finish it by copying and modifing add to subtract, etc.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!