def image_info(**o):
print(type(o))
print(o)
{
'image_title': 'my_cat',
'image_id': 1234
}
info = (
f"\"Image '{o['image_title']}'"
f" has id {o['image_id']}"
)
return info
info = image_info(image_title='my_cat', image_id=1234)
print(info)
Here is my code. How to create a TypeError error, for the absence of image_title and image_id?
def image_info(**o):
if 'image_title' + 'image_id':
raise TypeError("ERROR")
return (image_info)