After using Return statement it won't execute any of the below statement right!! | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

After using Return statement it won't execute any of the below statement right!!

When I removed the line below the return statement, it got executed but it says at top if page it's written that after using Return the below any statement won't execute

5th May 2018, 12:54 PM
tipton
tipton - avatar
24 ответов
- 1
return don't print values. you have to pass value function returning to use it later like https://code.sololearn.com/cr0Z9iO61MkY/?ref=app
5th May 2018, 1:25 PM
Yugabdh
Yugabdh - avatar
+ 1
Really!!
5th May 2018, 12:56 PM
tipton
tipton - avatar
+ 1
I guess he mean you sounds completely random. Please attach your code here so people will help you
5th May 2018, 1:00 PM
Yugabdh
Yugabdh - avatar
+ 1
*attach
5th May 2018, 1:04 PM
tipton
tipton - avatar
+ 1
Yes above code executes even after using Return statement and another problem is, at last so I have to use print(add_numbers (2,3)), why can't I use only , add_numbers(2, 3)
5th May 2018, 1:06 PM
tipton
tipton - avatar
+ 1
Ty man
5th May 2018, 1:26 PM
tipton
tipton - avatar
0
Wait
5th May 2018, 12:59 PM
tipton
tipton - avatar
0
How the heck I'll attack the code.... Even though I saved it isn't showing
5th May 2018, 1:03 PM
tipton
tipton - avatar
0
program is working totally fine and what you have learned is also totally correct. what actually happening is : in first part when ur using def it's defining function add_numbers when you call it in print statement it get executed. so first part is which is indented under def add_numbers is defining function and second one is call. You can directly use a = add_numbers (1,2) which also call that function and return value
5th May 2018, 1:17 PM
Yugabdh
Yugabdh - avatar
0
Then you can print a if you want
5th May 2018, 1:17 PM
Yugabdh
Yugabdh - avatar
0
Not if I don't use print at last then it doesn't execute, wait I'll send codes..
5th May 2018, 1:21 PM
tipton
tipton - avatar
0
Run above code and see no output
5th May 2018, 1:24 PM
tipton
tipton - avatar
0
As your program not printing any calculated value it's showing no output even it's calculating them.
5th May 2018, 1:26 PM
Yugabdh
Yugabdh - avatar
0
#paste ty
5th May 2018, 1:26 PM
tipton
tipton - avatar
0
np
5th May 2018, 1:28 PM
Yugabdh
Yugabdh - avatar
0
Hey wait
5th May 2018, 1:28 PM
tipton
tipton - avatar
0
Send that again please I, deleted that unknowingly
5th May 2018, 1:28 PM
tipton
tipton - avatar
0
Just click on link above
5th May 2018, 1:29 PM
Yugabdh
Yugabdh - avatar