ANSWER KEY
ANSWER KEY
ANSWER KEY
1. b) Self-driving car
Explanation: AI powers self-driving cars to analyze and make decisions.
2. c) def
Explanation: def is the Python keyword used to define a function.
3. b) 17
Explanation: Python follows operator precedence: 3 * 5 = 15 first, then 2 + 15 =
17.
4. d) Machine Learning
Explanation: Machine Learning is a technique within AI, not a type of AI like reactive
machines or limited memory.
5. d) Information
Explanation: AI domains include Data, Computer Vision, and NLP. "Information" is too
broad and not a specific AI domain.
6. b) Python is an interpreted language
Explanation: Python code is executed line-by-line at runtime, making it an interpreted
language.
7. a) input()
Explanation: The input() function is used to take user input in Python.
8. c) Integer
Explanation: len() returns an integer indicating the length of a string.
9. c) Artificial Intelligence
Explanation: AI simulates human intelligence in machines.
10. b) Testing the performance of the AI model
Explanation: Model Evaluation checks how well the trained model performs on unseen data.
1. True
Explanation: AI performs tasks requiring human-like intelligence, such as problem-solving
and learning.
2. False
Explanation: The else block is executed when the condition in an if statement is false, not
true.
3. True
Explanation: "Model Deployment" involves using the trained AI model in real-world
applications.
4. False
Explanation: Python supports object-oriented programming (OOP) with classes and objects.
5. False
Explanation: Data Pre-processing is an early step in the AI Project Cycle, not the final step.
Q1: Python Program to Print the Sum of the First 10 Natural Numbers
python
Copy code
# Initialize the sum variable
total_sum = 0
Output:
The sum of the first 10 natural numbers is: 55
Example Input/Output:
Input: 8
Output: The number 8 is even.
Input: 5
Output: The number 5 is odd.
Q4: Python Program to Find the Largest Number Among Three Numbers
python
Copy code
# Take three numbers as input from the user
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
num3 = float(input("Enter the third number: "))
Example Input/Output:
Input: 5, 10, 8
Output: The largest number among 5.0, 10.0, and 8.0 is: 10.0
Q5: Python Program to Find the Greater Value Among -12, 15, and 17
python
Copy code
# Initialize the numbers
a, b, c = -12, 15, 17
Output:
The greatest number among -12, 15, and 17 is: 17
1. Artificial Intelligence
2. Natural Language Processing
3. input
4. print
5. To check additional conditions
Q1: Define Artificial Intelligence (AI). Give two examples of AI in everyday life.
Definition: Artificial Intelligence (AI) is the simulation of human intelligence in machines that are
programmed to think and learn.
Examples:
Sequential Statements: These are executed line by line, in the order they appear.
Example:
python
Copy code
print("Hello")
print("World")
Selective Statements: These execute based on a condition, using constructs like if, if-else, or
elif.
Example:
python
Copy code
if age >= 18:
print("Eligible for voting")
else:
print("Not eligible")
1. Start.
2. Input the user's age.
3. If age ≥ 18, print "Eligible for driving license."
4. Else, print "Not eligible for driving license."
5. End.
(Refer to a drawing tool or pen to illustrate this: Include a start symbol, input age, decision
diamond, and outputs for eligibility.)
Definition: Data typecasting is the process of converting one data type into another in Python.
Types:
1. Implicit Typecasting: Python automatically converts smaller data types to larger ones (e.g.,
int to float).
2. Explicit Typecasting: The user manually converts a data type using functions like int(),
float(), str(), etc.
Section F: Long Answer Questions
Primitive Types:
Non-Primitive Types:
Definition: Comments are used to describe code and make it more readable.
Types:
python
Copy code
# This is a single-line comment
print("Hello World")
python
Copy code
'''
This is a
multi-line comment
'''
print("Hello World")
Advantages:
python
Copy code
num = int(input("Enter a number: "))
if num > 0:
print("The number is positive.")
else:
print("The number is negative.")
python
Copy code
print("Start")
print("Process")
print("End")
# Check if prime
if num > 1:
for i in range(2, num):
if num % i == 0:
print(f"{num} is not a prime number.")
break
else:
print(f"{num} is a prime number.")
else:
print(f"{num} is not a prime number.")