Name error, name a is not defined

sir i am not getting the result while substituting

a = 2
print(a) and run

getting this-
NameError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_18464/1189138062.py in
----> 1 print(a)

NameError: name ‘a’ is not defined

also i am getting answer of 1st shell again and agin,

also i am getting answer of 1st shell again and agin, suppose in first shell i write a =2 and if iusing 3rd shell i write a=“hello” then i am geting answer as a =2 while using print (a) command

hey @shubhamsharma231705,
just try restarting your notebook kernel and run all the cells one by one.