Python Full Stack Development - MCQ
Test
Questions
1. In Python, which function is used to take input from the user?
A) get()
B) input()
C) scanf()
D) print()
2. Which of the following is NOT a valid Python data type?
A) int
B) float
C) decimal
D) boolean
3. What is the correct extension for an HTML file?
A) .ht
B) .web
C) .html
D) .css
4. Which HTML tag is used to create the largest heading?
A) <heading>
B) <h6>
C) <h1>
D) <head>
5. In the CSS Box Model, what is the space called that is inside the border and around the
content?
A) Margin
B) Padding
C) Outline
D) Spacing
6. Which CSS property is used to change the text color of an element?
A) text-color
B) color
C) font-color
D) background-color
7. What does the 'C' in CSS stand for?
A) Creative
B) Common
C) Cascading
D) Computer
8. Which Flask function is used to display an HTML file to the user?
A) render_template()
B) show_html()
C) redirect()
D) display_page()
9. In Flask routing, what does the '@[Link]('/')' decorator define?
A) The database connection
B) The home page URL path
C) The CSS file path
D) The Python version
10. Which HTTP method is generally used to send sensitive data like passwords to a server?
A) GET
B) FETCH
C) SEND
D) POST
11. In Python, what does the '%' operator do?
A) Calculates percentage
B) Performs division
C) Returns the remainder (Modulus)
D) Multiplies two numbers
12. Which HTML tag is used to create a clickable link?
A) <link>
B) <a>
C) <href>
D) <url>
13. Which CSS selector is used to target an element with a specific class?
A) #classname
B) .classname
C) @classname
D) *classname
14. What is the purpose of the 'alt' attribute in an <img> tag?
A) Changes the image size
B) Displays text if the image fails to load
C) Links the image to another page
D) Adds a border to the image
15. In Flask, where should your CSS files be stored by default?
A) templates folder
B) root folder
C) static folder
D) css folder
16. Which Python statement is used to stop a loop prematurely?
A) stop
B) exit
C) break
D) end
17. Which CSS property controls how elements are aligned in a flexible container?
A) display: block
B) display: flex
C) align-items
D) float
18. What does Jinja2 use to display a variable in an HTML template?
A) [ variable ]
B) {{ variable }}
C) <% variable %>
D) { variable }
19. Which tag is used to create a text input field in an HTML form?
A) <text>
B) <form-input>
C) <input type='text'>
D) <textbox>
20. If 'if __name__ == "__main__":' is present in your Flask code, it ensures:
A) The code only runs if the script is executed directly
B) The code runs every time it is imported
C) The database is connected
D) The HTML is rendered
Answer Key
1. B
2. C
3. C
4. C
5. B
6. B
7. C
8. A
9. B
10. D
11. C
12. B
13. B
14. B
15. C
16. C
17. B
18. B
19. C
20. A