#๐Ÿ”’ Coding help

28 messages ยท Page 1 of 1 (latest)

hard spindle
#

basically, im supposed to write a code where you input your overall average in a class, you input your midterm exam test grade, and then use those two to calculate what grade you need in the final exam to pass, the problem is i dont know how to convert this mathematical equation to python code and i also am not fully sure how the equation works.

north vineBOT
#

@hard spindle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

hard spindle
#
code so far:

overall = int(input("What is your Overall Mark?:  "))
print(overall)

if 0 < overall <=100:
    average = int(input("What was your Midterm Average?  "))
else:
    print("Your Overall has to be between 0 - 100 ")
    
if 0 < average <=100:
    print(average)
else:
    print("Your Average has to be between 0 - 100")
    
waxen solar
#

The equation is just basic math. Use () parenthesis to keep the order of operations straight.

hard spindle
#

i know its basic math but I'm not entirely sure how to write it in code, im pretty new.

waxen solar
#

Do you know PEMDAS as in order of operations?

hard spindle
#

yeah parenthesis, exponents, multiplication, division, addition, subtraction. i think i got it written down but its giving me the wrong answer.

waxen solar
#

post your code

#

or math

hard spindle
#

!code

north vineBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

hard spindle
#
overall = int(input("What is your Overall Mark?:  "))
print(overall)

if 0 < overall <=100:
    average = int(input("What was your Midterm Average?  "))
else:
    print("Your Overall has to be between 0 - 100 ")
    
if 0 < average <=100:
    print(average)
    needed = ((50 + average - overall)*0.6)/0.4
    print (needed)
else:
    print("Your Average has to be between 0 - 100")
    
#

if i input 100 for both the overall and average, "needed" is supposed to come out as 20, instead it came out as 75, so now im confused.

waxen solar
#

I think it is term(dash)average not term(minus)average

#

So the midterm must be included in term average

hard spindle
#

so add them instead of subtract, okay.

#

oh no thats very very wrong, it came out as 375

waxen solar
#

No you have to average them by hand before. Please post instructions

hard spindle
#

yeah thats a good idea one sec

#

i had too DM you them because it wont let me post PDFs

#

sorry I'm trying my best but I'm sick, stressed, and have a headache and am very confused lol but i am trying. lol

hard spindle
#

from the first picture on page 3 in the pdf, if both inputs are 100, the output should be 20

waxen solar
#

Yeah that is a lot. I don't get what they want either. Sorry.

hard spindle
#

Thatโ€™s alright Iโ€™m still super confused Iโ€™ll just keep trying until I get it or someone else is able to help me figure it out.

#

!close

north vineBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.