Quiz Space

MAD 1 End Term: 7 August 2022 (May 2022 term)

Question 1

+2 marksOne correct option

Which of the following correctly represents the components of the given URL?

  1. A
  2. B
  3. C
  4. D

Question 2

+2 marksOne correct option

Consider the following flask app and an HTML file in templates folder:

Python file: app.py

python
from flask import Flask, render_template
app = Flask(__name__)
my_list = ['Web development','onlinedegree','cs2003',
'MAD-I','Data_science']
@app.route('/')
def render():
return render_template('index.html', my_list = my_list)
app.run(debug = True)

Template file:

html
<!DOCTYPE html>
<head>
<style>
body{width: 200px;
border: 2px solid black}
#one{color:red;}
#two{color:blue;}
</style>
</head>
<body>
{% for item in my_list %}
{% set Length = item|length %}
{% if Length%2 == 0 %}
<h3 id = "one">{{ item }}</h3>
{% else %}
<h3 id = "two">{{ item }}</h3>
{% endif %}
{% endfor %}
</body>

If the above flask app is running locally on http://127.0.0.1:5000/, what will be rendered by the browser for the base URL?

  1. A
  2. B
  3. C
  4. D

Question 3

+2 marksOne correct option

Consider the flask code given below.

Python file: app.py

python
from flask import Flask, jsonify, request
app = Flask(__name__)
my_shops= [
{
'name of the shop' : 'Grocery',
'items' : [
{
'item1' : 'Toothpaste',
'item2' : 'Snacks',
'item3' : 'Biscuits',
'item4' : 'Soaps'
}
]
}
]
@app.route('/')
def show_shop():
return jsonify({"shops" : my_shops})
#======================
CODE HERE
#======================
if __name__ == '__main__':
app.run()

Which of the following code snippets must be added in the given space of above application, in order to create a new shop in ‘my_shops’ list on the server side apart from the existing one?

  1. A
  2. B
  3. C
  4. D

29 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the MAD 1 End Term 7 Aug 2022 paper

The IIT Madras BS Modern Application Development I (MAD 1) End Term paper sat on 7 Aug 2022, in the May 2022 term: 32 questions for 100 marks in 180 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureMAD 1 End Term 7 Aug 2022 at a glance
TermMay 2022 term
SubjectModern Application Development I
Course codeBSCS2003
Questions32
Marks100
Duration180 min
MCQ25
MSQ6
Numerical1
Official paperIIT M FOUNDATION DIPLOMA ENDTERM QPD1 07 Aug 2022 IBA NS
Negative markingNo negative marking.
Updated

Same End Term, other subjects

More MAD 1