What is the difference between inheritance and polymorphism?
Implement a Python function that demonstrates both concepts by formatting notification records through a shared interface. Each record must be converted to the appropriate subclass, and the function must invoke the same polymorphic method for every object.
Input: a list of dictionaries with type and type-specific fields. Output: a list of formatted strings in the original order.
Supported formats: email produces EMAIL: recipient | subject, SMS produces SMS: phone | body, and push produces PUSH: device | title: body.
email, sms, or pushdef format_notifications(records):