06/ 01/ 2022 Python Quiz solutions

hey folks,
thank you all for your participation in the quiz yesterday. i hope you found it interesting.
here are the solutions for the quiz.

  1. Answer: c
    Explanation: IndexError, the tuple index is out of range. we needed two items inside format. we only have one.

  2. Answer: b
    Explanation: there is a space between a and B. and space doesnt come under isalpha().

  3. Answer: c
    Explanation: Sorting doesnt work between integers and strings and first index of the tuples contain string and integer.

  4. Answer: d
    Explanation: The fill character must be exactly one character long.

  5. Answer: a
    Explanation: Counts the number of times the substring ‘yy’ is present in the given string, starting from position 1.

if you have any queries, do ask. we’ll be clearing them.