i want python code for 2 questions in the attached document all the details are mentioned in the document

Codes are expected to be clear, legible and compact with minimum number of

lines and variables, and proper indentation. Variable names are expected to be

appropriate, meaningful and self-explanatory.

No plagarism. Please find the attached copy of 2 files.