I have a math problem so this is the code and he didn't work so why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I have a math problem so this is the code and he didn't work so why?

https://code.sololearn.com/ch3SmdAN5qiY/?ref=app

27th Sep 2022, 4:43 PM
Audibert
Audibert - avatar
16 Answers
+ 5
WHAT OUTPUT DO YOU ***EXPECT***? You need to call the function with () AND arguments for a, b, c! For example: print(equation(1, 1, 1))
27th Sep 2022, 5:59 PM
Lisa
Lisa - avatar
+ 6
Constant Audibert One of the most needed skills for a programmer is to communicate in a logical way. 1. "I have a math problem". Which one? 2. "It didn't work". What should it do? What did it do instead? 3. "The output is strange". How? Vague information leaves us only guessing. Also, you had good answers (as possible without minimal info). Read them, answer the requests for info and apply the suggestions. Allow people to help you.
28th Sep 2022, 3:20 AM
Emerson Prado
Emerson Prado - avatar
+ 5
You are not calling. printing function reference. You are not passing arguments.. Pass a, b, c try print(equation(a,b,c)) print(equation(1,2,1)) print(equation(4,3,1))
27th Sep 2022, 5:59 PM
Jayakrishna 🇮🇳
+ 2
What input do you test? What output do you expect? You never called the function in your code.
27th Sep 2022, 4:54 PM
Lisa
Lisa - avatar
+ 2
Did not works means? No output? : you have function definition only. To use it, call or invoke it. Any other?
27th Sep 2022, 4:55 PM
Jayakrishna 🇮🇳
+ 1
Thanks Lisa and Jayakrishna. When I invoke the function the output is strange
27th Sep 2022, 5:42 PM
Audibert
Audibert - avatar
+ 1
Ты не нашел корень(√), но я сделал похожую на твою: https://code.sololearn.com/cQ8X0B4T9tTn/?ref=app
28th Sep 2022, 10:56 AM
Алихан Т
Алихан Т - avatar
+ 1
when you want to call any function, you have to find out if it has arguments, and then call it from another function (like in your case, print())
28th Sep 2022, 11:45 AM
Amazon
Amazon - avatar
+ 1
thanks everyone for taking the time to respond.
28th Sep 2022, 6:50 PM
Audibert
Audibert - avatar
+ 1
The arguments declared in the parentheses of the function are only for that function to use, not anything else's. This means that, even though you assigned a, b, and c, the arguments of the function don't get assigned. Plus, calling the function's name without the parentheses, after you declared it, will only show the info of it. Well, in JS, but Python shows something... different.
29th Sep 2022, 12:47 AM
Chi Zu
Chi Zu - avatar
+ 1
Fix the last line>>>print(equation(a,b,c))
29th Sep 2022, 6:48 AM
ali khodatars
ali khodatars - avatar
+ 1
Aryaman Madge Pls don't offer ready solutions. Remember this is a learning app, so the OP has to go through the solving process to learn. Prefer giving hints for the OP to find the solution. Also, pls don't write in all upper case. This means shouting.
1st Oct 2022, 3:18 AM
Emerson Prado
Emerson Prado - avatar
0
I think you should visit work more and more with people this is because of no enough information.And dont say that no output the thing is the output is not as you expected
29th Sep 2022, 6:59 AM
british my
british my - avatar
0
WHICH PROGRAMMING LANGUAGE AND WHAT MATH PROBLEM I WILL SOLVE IT.
29th Sep 2022, 12:44 PM
Aryaman Madge
Aryaman Madge - avatar
0
Aryaman Madge If you read the OP's replies you can find out what it is about. Apparently, OP was able to fix their code issue now.
29th Sep 2022, 12:50 PM
Lisa
Lisa - avatar
- 2
По
29th Sep 2022, 4:32 PM
Мусо Косимов
Мусо Косимов - avatar