python exercise: 1. Write a Python function called generate_quiz_question that takes a list of quiz questions (represented as tuples of the question and answer) as input and returns a randomly selected question from the list. The function should also prompt the user to enter their answer to the question, and then check whether the user's answer is correct or not. If the user's answer is correct, the function should return True. Otherwise, it should return False.   2. Write a function is_palindrome(s) that takes a string s as input and returns True if s is a palindrome (i.e., reads the same backwards and forwards), and False otherwise   3. Write a Python function called get_top_students that takes the list of dictionaries as input and returns a dictionary containing the name and GPA of the top two students in the list. Each dictionary has the following keys: "name", "age", "major", and "gpa".

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 12VE
icon
Related questions
Question

python exercise:

1. Write a Python function called generate_quiz_question that takes a list of quiz questions (represented as tuples of the question and answer) as input and returns a randomly selected question from the list. The function should also prompt the user to enter their answer to the question, and then check whether the user's answer is correct or not. If the user's answer is correct, the function should return True. Otherwise, it should return False.

 

2. Write a function is_palindrome(s) that takes a string s as input and returns True if s is a palindrome (i.e., reads the same backwards and forwards), and False otherwise

 

3. Write a Python function called get_top_students that takes the list of dictionaries as input and returns a dictionary containing the name and GPA of the top two students in the list. Each dictionary has the following keys: "name", "age", "major", and "gpa". 

 

Expert Solution
steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Linked List Representation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning