''' 1. An abstract method is a method that is declared, but contains no implementation. 2. By defining an abstract base class, you can define a common API for a set of subclasses. 3. By using abc module we can define abstract class. ''' from abc import ABCMeta,abstractmethod class One(metaclass=ABCMeta): @abstractmethod def add(self): print(' \n ONE ADD ') @abstractmethod def sub(self): pass #a = One() #a.add() ## If you inheritence an abstaruact class you should impliment that all those methods which are abstract ,methods class Two(One): def add(self): print(" \n TWO ADD") def sub(self): print(' \n TWO SUB') ins = Two() ins.add() ins.sub()
# What is python ? 1. Python is a high level interpriter programing language. 2. Python supports OOP. 3. Python language used in many areas for developing web applications, automate webapplications with selenium ,Machine Learning, Automation, IOT, Network Programming, Text processing and Multimedia. # Advantages of python ? 1. Python is easy to learn and use 2. Python syntax is easy to use and Simple. 3. Python supports OOP, modules and packages. 4. It is a Interpreted language 5. Compatible with Major Platforms 6. Python has Extensive Support Libraries like(panda, numpy, matplotlib) and frameworks(django, flask, bottle and Robot Framework) 7. Python is a open source. # Dis Advanatges in python ? 1. Python runs only on single core. 2. It is not suitable for mobile applications. 3. Sp...
''' 1. Tuple is used to store multiple values and we can do operation on each value based on index. 2. Tuple is a read only object, we can't do update,insert and delete operations. 3. Using parentheses "()" we can create a tuple 4. tuple is a immutable object 5. To store sensitive data we use tuple. ''' # To create a tuple names = ('umamahesh','kumar','balu','ram', 567, 99.9) # Tuple doesn't support for item deltion and update names[3] = 'ok' del names[3] # To print particular value based on index print(names[4]) print(names[-1]) # To delete a total tuple del names
Comments
Post a Comment