Python Forum
Stuck on Python Lab, Thank you for your help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stuck on Python Lab, Thank you for your help
#1
Hi there,
I am new to Python and currently doing a Open University introductory course. I am currently at the end of Module 2 and have this lab task to complete. It is not particularly difficult I am sure, but I can't seem to get my head around how to organize the operations based on the hierarchy to produce the correct answer.

Scenario
Your task is to complete the code in order to evaluate the following expression:


The result should be assigned to y. Be careful - watch the operators and keep their priorities in mind. Don't hesitate to use as many parentheses as you need.

You can use additional variables to shorten the expression (but it's not necessary). Test your code carefully.


Test Data
Sample input: 1

Expected output:

y = 0.6000000000000001

Thank you in advance,
Charlie
Reply


Messages In This Thread
Stuck on Python Lab, Thank you for your help - by charliedale55 - Nov-24-2020, 09:06 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020