loading...

re: 10 Python Interview Questions and Answers for Freshers VIEW POST

FULL DISCUSSION
 

Python is Very Easy to learn as compared to java.

While I do agree it still leaves room to some subjectivity. Anyone used to static typed languages for many years will find python unnatural. Especially all the quirks it provides.

in Java, multiple inheritance is done through the interface.

This is more commonly referred to as composition, not inheritance.

you should avoid list comprehension because sometimes it makes code hard to read for humans.

This shouldn't be pigeonholed to list comprehensions, or even python. It's simple as "don't write code someone else can't read"

Difference between Python list and array

If talking about python in particular you need to mention more. Like array.array is essentially a thin wrapper on a C array so another limitation is that it should be single type.

they are read-only, example tuple

Caveat - if a tuple holds references to mutable objects then said mutable objects can be mutated, making the tuple appear mutable. Not really a fault of tuple but if someone mentioned that then this would be my next question.

 

Thanks for all these suggestions.
Sorry for the list vs array confusion, the interviewer referred to the array of C language because it was in my resume :).
I think the immutable definition needs some more reference for the explanation, I have added a link which describes that.
Please let me know if anything needs a fix.

code of conduct - report abuse