hisoka 2 Posted April 13, 2015 Report Share Posted April 13, 2015 In python interpreter prompt command , I got this result : >>> a= 25 >>> b 3 >>> a=120 >>> b 3 I could not understanding why I got 3 as a result . What is the explanation of getting 3 as a result or why I get 3 as a result ?? Quote Link to post Share on other sites
Ingolme 1,031 Posted April 13, 2015 Report Share Posted April 13, 2015 You're asking it for b, the value you set was a b was probably set to 3 earlier. Quote Link to post Share on other sites
hisoka 2 Posted April 13, 2015 Author Report Share Posted April 13, 2015 (edited) You're asking it for b, the value you set was a b was probably set to 3 earlier. No no I did not . I did not assign any value to b I begun the little piece of code like this >>> a = 123 >>> b (then when I pressed enter ) I got 3 as a result believe me now i tried again but when I pressed enter I got this error : name 'b' is not defined now a value should assigned to b Now I assigned a value to be b and now it is printed normally but before the result was 3 Edited April 13, 2015 by hisoka Quote Link to post Share on other sites
Ingolme 1,031 Posted April 14, 2015 Report Share Posted April 14, 2015 It's impossible to know now whether you gave b a value or not, but computers only do what they're told. If b had a value it's almost certainly because somebody set that value. 1 Quote Link to post Share on other sites
hisoka 2 Posted April 27, 2015 Author Report Share Posted April 27, 2015 You are right . I made an unconscious error Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.