Quiz Space

Modern Application Development I · End Term · 13 Apr 2025 · January 2025 term · Set QDD1

Question 27: The students of IITM BS challenged their instructors to …

Question 27

+2 marksOne correct option

The students of IITM BS challenged their instructors to a cricket match. A Flask web application is built to track the scores. Below is the Flask app code that defines multiple routes for fetching scores dynamically.

python
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return "Welcome to the IITM BS Cricket Match Scoreboard!"
@app.route('/score/<team>')
def team_score(team):
scores = {"students": 120, "instructors": 115}
return f"{team.capitalize()} Score: {scores.get(team, 'Team not found')}"
@app.route('/score/<team>/<player>')
def player_score(team, player):
players = {
"students": {"Rahul": 45, "Ananya": 30, "Karthik": 25},
"instructors": {"Prof.Prashant": 40, "Prof.Mayur": 35, "Dr.Subendu": 20}
}
return f"{player} ({team.capitalize()}) Scored: {players.get(team, {}).get(player, 'Player not found')}"
if __name__ == "__main__":
app.run(debug=True)

Based on the above data, answer the given subquestions.

  1. A

    Students Score: 120

  2. B

    students Score : 120

  3. C

    Team not found

  4. D

    Score: students

Show answer

Correct answer

  • A

    Students Score: 120

Question 27 of 32 in the IIT Madras BS Modern Application Development I (MAD 1) End Term paper sat on 13 Apr 2025, in the January 2025 term (IIT M DIPLOMA AN EXAM QDD3 13 Apr 2025). It carries 2 marks.

More questions from this paper

  1. Q1Figure question
  2. Q2Consider the following Python code snippet. What will be the output on the terminal?
  3. Q3Figure question
  4. Q4Figure question
  5. Q5Consider the following example: Which of the following accessibility principles is followed in this example?
  6. Q6A Flask application and its absolute path is given below. app.py If the application is run locally on http://127.0.0.1:…
  7. Q7Figure question
  8. Q8A Server S needs to retrieve data from two datacenters D1 and D2 located at 1500 kilometres and 3000 kilometres respect…
  9. Q9Figure question
  10. Q10Figure question
  11. Q11Consider the following flask app. Given that test_request_context() allows text to be printed on the terminal, which of…
  12. Q12Consider the following Python code snippet. If this application is running locally on http://127.0.0.1:5000, which of t…
  13. Q13Consider the following HTML code . File name: login.html When the user clicks on the “Login” button the form data will …
  14. Q14Consider the code below in a file called test_students.py. test_students.py What will be the output on the terminal on …
  15. Q15Consider the following Python code. File name: main.py What will be the output, when running the above code using the c…
  16. Q16Consider the following Python code File name: main_test.py What will be the output of running the above python script u…
  17. Q17Consider the following Jinja2 templating code: Will the above Jinja templating code return the correct output? If yes, …
  18. Q18You are given a project with three files: conftest.py, test_multiples_of_3_and_6.py, and test_multiples_of_13.py. The p…
  19. Q19A client machine and a server machine located 120 kilometers apart start moving towards each other along a straight lin…
  20. Q20Figure question
  21. Q21Consider a flask app "app.py" and a template file "doc.html" given below: Python file: app.py Template file: doc.html I…
  22. Q22Which of the following statements about networking concepts (TCP, UDP, Proxy, Peer-to-Peer, Broadcast, Unicast, Multica…
  23. Q23Consider the following route in the flask for a signup page and select the correct option:
  24. Q24Figure question
  25. Q25The following Flask-RESTful API code snippet is intended to create a RESTful API for managing student registrations in …
  26. Q26Consider the following Flask app code. Assume the above flask app runs on “http://127.0.0.1:5000/” and is accessed thro…
  27. Q28The students of IITM BS challenged their instructors to a cricket match. A Flask web application is built to track the …
  28. Q29Which of the following storage types should be used for storing frequently accessed small student records that need low…
  29. Q30The college wants to store archived counseling records from past students for future reference. These records are rarel…
  30. Q31Which of the following statements is/are True?
  31. Q32Which of the following is the correct way of adding records into the ‘student’ and the ‘test_marks’ tables?