Quiz Space

MAD 1 End Term: 28 April 2024, Set QDF1 (January 2024 term)

Question 1

+3 marksOne correct option

Consider the following Python code snippet.

python
from string import Template as makeTemplate
from jinja2 import Template
import sys
var = sys.argv[0]
data = {"var1": "Data scientist", "var2": "programming",
"var3": "statistical", "var4": "insights"}
temp = "{{var1}} creates $var2 code with $var3 knowledge to create
{{var4}}."
if var == "1":
temp = makeTemplate(temp)
output = temp.substitute(data)
print(output)
else:
temp = Template(temp)
output = temp.render(data)
print(output)

What will be printed on the terminal for the command python app.py 1 2 ?

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

Question 2

+2 marksOne correct option

Consider the following flask application running locally on http://127.0.0.1:5000 ?

python
from flask import Flask
app = Flask(__name__)
@app.route('/home/<string:url>')
def get_url_str(url):
return "string "+url
@app.route('/home/<path:url>')
def get_url_pth(url):
return "path "+url
app.run(debug = True)

Which of the following URLs will throw a 404 Not Found error?

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

Question 3

+2 marksOne correct option

Consider the following view function.

python
from flask import Flask, request
app = Flask(__name__)
@app.route('/student', methods = ['GET', 'POST'])
def show_details():
cred = request.args
details = {
'Stream': cred['dept'],
'Roll': cred['roll'],
'Course': cred['course']
}
return details
app.run()

If this flask app is running locally on http://127.0.0.1:5000, which of the following URLs will be handled by the controller correctly?

  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 28 Apr 2024 Set QDF1 paper

The IIT Madras BS Modern Application Development I (MAD 1) End Term paper sat on 28 Apr 2024, in the January 2024 term, set QDF1: 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 28 Apr 2024 Set QDF1 at a glance
TermJanuary 2024 term
SubjectModern Application Development I
Course codeBSCS2003
Questions32
Marks100
Duration180 min
MCQ26
MSQ6
Official paperIIT M FOUNDATION DIPLOMA AN EXAM QDF3 28 Apr 2024
Negative markingNo negative marking.
Updated

Other sets that day

Same End Term, other subjects

More MAD 1