Create a `CustomError` class inheriting from `Exception`. Override `__init__` to accept a `message` and call `super().__init__(message)`. Read an integer. If it exceeds 100, raise `CustomError(‘Value too high’)`. Catch and print the exception object directly.
A single integer.
Print 'OK' or the exception message.
None
150
Value too high
Calling super().__init__() ensures the base Exception class properly registers your custom message.
class CustomError(Exception):
# Define __init__ calling super()
pass
if __name__ == '__main__':
val = int(input())
# Write try-except block
passEmbedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used