Python Full Stack Web Development -
Surprise Test
SET A
Duration: 30 Minutes | Total Marks: 20 (2 Marks each)
1. 1. Write a Python statement to take a number input from a user and store it in a variable
called 'val'.
2. 2. Explain the purpose of the 'if __name__ == "__main__":' line in a Flask application.
3. 3. Write the HTML tag used to create a hyperlink that points to '/login'.
4. 4. Define the 'Padding' property in the CSS Box Model.
5. 5. Write a Python code snippet to check if a number 'x' is even or odd using an if-else
statement.
6. 6. Which Flask decorator is used to define a URL path for a function? Give an example.
7. 7. What is the difference between 'Inline CSS' and 'Internal CSS'?
8. 8. Create an HTML input field specifically for entering a password.
9. 9. Write the CSS code to change the background color of a <div> with class 'container' to
lightgray.
10. 10. In Flask routing, what does the syntax '<int:age>' do in a URL path?
SET B
Duration: 30 Minutes | Total Marks: 20 (2 Marks each)
11. 1. Write a Python program to display 'Hello from Flask Backend!' on the screen.
12. 2. What is the role of the 'render_template' function in a Flask application?
13. 3. Create an HTML form tag that uses the 'POST' method and targets the '/submit'
action.
14. 4. Explain the 'Fixed' position property in CSS.
15. 5. Write a Python script that calculates a 10% discount on a variable named 'price'.
16. 6. What is the purpose of the <title> tag in an HTML document?
17. 7. Write the CSS hover effect syntax to change a button's opacity to 0.7.
18. 8. In the CSS Box Model, what is the difference between 'Margin' and 'Padding'?
19. 9. Create an HTML structure for a heading (H2) that says 'Registration Form'.
20. 10. Write a Flask route for a page called '/about' that returns the text 'About Us Page'.