User Varialble input failure I'm trying to enter dimensions of an object.  I'm using the code below.
It does not recognize the variables XX or YY and get the error: Key "XX" not found
Any clues??

import bpy
from bpy.props import FloatProperty
from bpy.props import IntProperty
from bpy.types import Operator
import os

#create variables 
bpy.types.Scene.XX=FloatProperty(name="XX", default=10.0, description="Enter XX") #XX
XX = bpy.context.scene['XX']
#print (XX) 

bpy.types.Scene.YY=FloatProperty(name="YY",default=4, description="Enter YY") #YY
YY = bpy.context.scene['YY']
#print (YY) 
#Draw the panel buttons for user inputs
class CustomPanel(bpy.types.Panel):
    bl_label = "Wall"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.label(text="Dimensions:")
        Wall_layout=self.layout.column(align=True)
        Wall_layout.prop(context.scene, 'XX') #XX
        Wall_layout.prop(context.scene, 'YY') #YY

def register():
    bpy.utils.register_class(CustomPanel)

def unregister():
    bpy.utils.unregister_class(CustomPanel)

if __name__ == "__main__":
    register()
You have defined a RNA property, it will be available on any instance of this class( all scenes will have this property ) , to access this property use the following line  :

XX = context.scene.XX
# in the UI
row.prop(context.scene, 'XX')


you can also define an ID property which will be available only on this scene :

context.scene['XX'] = 10.0
print(context.scene['XX'])
#in UI
row.prop(context.scene, '["XX"]')


To learn more about this Topic refer to this DOC page : RNA properties versus ID properties