I faced a great doubt about the Complexity of two ways of calling a information.First I have an Array, if I call an array in a program like this:print array[0]This process will be O(1) as I understand.But what is the complexity of something like this:class Obj:    value = 1print Obj.valueIs this complexity is the same of callin and array by Index? If we ignore the process to create the object.
What is the complexity of Array[n] and Object.value
algorithm analysis;data structures;programming languages;runtime analysis
If you have CPython in mind then yes, the both are $O(1)$.To get array by index the address is calculated as pointer to first element + index * size of element, and for object, which uses struct it is pointer to struct + offset, where offset is calculated at compilation.The general runtime of operations depends solely on data structure used internally by given implementation of language (please note that language itself might not indicate what structure must be used and the very same language might have different structures using different vendors). It may be offset table, hash table, balanced tree etc.