[Tutor] Difference between decorator and inheritance

2019-08-01 Thread Gursimran Maken
Hi, Anyone could please let me know the difference between decorators and inheritance in python. Both are required to add additional functionality to a method then why are we having 2 separate things in python for doing same kind of work. Thank you, Gursimran

[Tutor] Output reason

2019-07-12 Thread Gursimran Maken
Hi, Can someone please explain me the reason for below output. Program: def fun(n,li = []): a = list(range(5)) li.append(a) print(li) fun(4) fun(5,[7,8,9]) fun(4,[7,8,9]) fun(5) # reason for output (why am I getting to values in this output.) Output: [[0, 1, 2, 3, 4]] [7, 8, 9, [0,

Re: [Tutor] Pickles and Shelves Concept

2019-06-08 Thread Gursimran Maken
Thank you all for explaining me the above concept. On Sat, Jun 8, 2019 at 5:27 PM Alan Gauld via Tutor wrote: > On 08/06/2019 01:02, Alan Gauld via Tutor wrote: > > > keys to your data and then restore it in any sequence, or > > only restore some of it, you can. > > Apologies for the Yoda-speak

[Tutor] Pickles and Shelves Concept

2019-06-07 Thread Gursimran Maken
Hi All, I am not getting the concept of pickle and shelves in python, I mean what's the use of both the concepts, when to use them in code instead of using file read and write operations. Could anyone please explain me the concepts. Thank you, Gursimran.