Thanks everyone for promptly answering my question.
Answer to Gary's question,
I haven't used named tuples and tried it. The way the tuple subclass
getting created plus the property features i wasn't much aware of.
But now i am very clear, how I set ID object and changed the interface to
access I
>
> So now the real question is: What were you trying to accomplish with
> the assignment? Tell us, and let's see if we can find a way to
> accomplish yor goal without wrecking the internals of the Grade class.
>
> And depending on your answer to that question, the new Data Classes
feature in 3.7
On 10/17/2018 11:13 PM, me.vi...@gmail.com wrote:
Hi,
I tried using namedtuples and just found a behaviour which I am not able to
conclude as correct behaviour.
from collections import namedtuple
(n, categories) = (int(input()), input().split())
Grade = namedtuple('Grade', categories)
Grade.
Vinodhini Balusamy wrote:
> Hi,
>
> I tried using namedtuples and just found a behaviour which I am not able
> to conclude as correct behaviour.
>
> from collections import namedtuple
>
> (n, categories) = (int(input()), input().split())
> Grade = namedtuple('Grade', categories)
> Grade.ID = 1
Hi,
I tried using namedtuples and just found a behaviour which I am not able to
conclude as correct behaviour.
from collections import namedtuple
(n, categories) = (int(input()), input().split())
Grade = namedtuple('Grade', categories)
Grade.ID = 1
#print(Grade.ID)
ob = Grade(10, 50)
print(ob.ID