Is it possible to use the value initialized in 1st code block in 2nd code block? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is it possible to use the value initialized in 1st code block in 2nd code block?

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

30th Jan 2018, 6:10 AM
Deepak Bhalode
Deepak Bhalode - avatar
5 Answers
+ 4
You can pass arguments to allow access. https://code.sololearn.com/cvL7Ahhj6Gdj/?ref=app
30th Jan 2018, 1:33 PM
John Wells
John Wells - avatar
+ 5
Variables have scope so your add is outside of the scope a & b were defined in so it can't access them.
30th Jan 2018, 6:31 AM
John Wells
John Wells - avatar
+ 2
yess
30th Jan 2018, 9:11 AM
Viryl15
Viryl15 - avatar
+ 2
thnku John sir
30th Jan 2018, 2:58 PM
Deepak Bhalode
Deepak Bhalode - avatar
+ 1
y I can't use the concept of function ..."passing the value"...in this code??
30th Jan 2018, 1:15 PM
Deepak Bhalode
Deepak Bhalode - avatar