Python Forum
Stuck on Python Lab, Thank you for your help - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Stuck on Python Lab, Thank you for your help (/thread-31139.html)



Stuck on Python Lab, Thank you for your help - charliedale55 - Nov-24-2020

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


RE: Stuck on Python Lab, Thank you for your help - deanhystad - Nov-25-2020

Where is the expression?


RE: Stuck on Python Lab, Thank you for your help - perfringo - Nov-25-2020

And now something totally different: pythonlabs.com