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
#2
Where is the expression?
Reply
#3
And now something totally different: pythonlabs.com
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Forum Jump:

User Panel Messages

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