Important Work Sheet

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

Important Work Sheet

Name - _________________________

Class – 9th (section - ______)

Date – 11-December-2024

1. Examples of AI:
o AI in self-driving cars: AI systems help in making
decisions and controlling the car.
o Human Brain is not AI, though it inspires AI models.
2. Python Keywords:
o def: Used to define a function in Python.
o else: Executes when the condition in if is false.
3. Python Expressions:
o Understand operator precedence. 3 * 5 is calculated
before adding 2.
o Example: 2 + 3 * 5 gives 17.
4. AI Types:
o Types of AI: Reactive machines, Limited memory, Self-
aware AI, and Machine Learning.
5. Domains of AI:
o AI domains: NLP (Natural Language Processing),
Computer Vision, etc. Information is not a domain of
AI.
6. Python Features:
o Python is an interpreted language (not compiled).
o Loops and other features are fully supported.
7. Python for Input/Output:
o Use input() to get user input.
o Use print() for output.
8. Data Types in Python:
o len("Hello") returns an integer (length of string).
9. AI Definition:
o Artificial Intelligence (AI): The simulation of human
intelligence by machines.
10. Model Evaluation in AI:
 In the AI Project Cycle, Model Evaluation means testing the
performance of the trained model.

1. AI systems can do tasks requiring human intelligence.


2. The 'else' block executes when the 'if' condition is false.
3. Model Deployment refers to the production use of the trained
AI model.
4. Python supports object-oriented programming (OOP).
5. Data Pre-processing is not the final step in the AI cycle; it
happens earlier.

Application Based Section


1. Sum of First 10 Natural Numbers:
o Use a for loop to sum the first 10 numbers.
python

sum = 0
for i in range(1, 11):
sum += i
print(sum)
2. Even or Odd Check:
o Use if-else to check divisibility by 2.
python

num = int(input())
if num % 2 == 0:
print("Even")
else:
print("Odd")
3. Flowchart and Algorithm:
o Ensure you understand basic flowchart symbols and their
meaning.
o Example: A flowchart will use decisions (diamond),
processes (rectangles), and connectors (arrows).
4. Find Largest of Three Numbers:
o Use if-elif-else to compare the three numbers.
python

a = int(input())
b = int(input())
c = int(input())
if a >= b and a >= c:
print("Largest:", a)
elif b >= c:
print("Largest:", b)
else:
print("Largest:", c)
5. Find Greater Value Between -12, 15, 17:
o Compare numbers and find the greatest.
python

max_val = max(-12, 15, 17)


print("Greatest value:", max_val)

1. AI stands for Artificial Intelligence.


2. NLP stands for Natural Language Processing.
3. Python uses input() for taking user input.
4. Python uses print() for giving output.
5. elif is used to add another condition in an if-else chain.

1. AI Definition: AI simulates human intelligence, e.g., voice


assistants, self-driving cars.
2. Sequential vs Selective Statements:
o Sequential: Code runs in order, step by step.
o Selective: Decisions are made using if-else.
3. Flowchart Shapes:
o Oval: Start/End
o Rectangle: Process/Action
o Diamond: Decision
4. Algorithm for Driving License Eligibility:
text

1. Input age
2. If age >= 18, print "Eligible"
3. Else, print "Not Eligible"
5. Flowchart for Driving License:
o A flowchart for eligibility includes decision points based
on age input.

1. Data Types in Python:


o int: Integer numbers, e.g., 5.
o float: Decimal numbers, e.g., 3.14.
o str: String of characters, e.g., "Hello".
o bool: Boolean values, e.g., True, False.
o Example of conversion (typecasting):
python

x = int(3.5) # Converts float to int


2. Purpose of Comments:
o Comments are used to explain code.
o Types:
 Single-line comments: # This is a comment
 Multi-line comments: """ This is a comment
"""
3. Advantages & Disadvantages of Flowchart & Algorithm:
o Advantages: Easy visualization (flowcharts), clear step-
by-step instructions (algorithms).
o Disadvantages: Flowcharts can get complex, algorithms
might miss exceptions.
4. Main Concepts of AI:
o Machine Learning: Learning from data.
o Natural Language Processing: Interpreting human
language.
o Computer Vision: Interpreting visual data.
o Robotics: Designing intelligent machines.
5. If-Else Statements Example:
o To check if a number is positive or negative:
python

num = int(input())
if num > 0:
print("Positive")
else:
print("Negative")
6. Sequential Flow:
o Code runs in a specific sequence, one step after the other.
o Example: Calculating the area of a rectangle:
python

length = 5
width = 3
area = length * width
print(area)
7. Prime Number Program:
o Check if a number is prime:
python

num = int(input())
if num > 1:
for i in range(2, num):
if num % i == 0:
print("Not prime")
break
else:
print("Prime")
else:
print("Not prime")

Self Test - 2
Section A: Multiple Choice Questions (MCQs)
1. Which of the following is an example of Artificial Intelligence?
o a) Human brain
o b) Self-driving car
o c) Computer mouse
o d) Television
2. What is the keyword used to define a function in Python?
o a) function
o b) define
o c) def
o d) func
3. What will be the output of the following code in Python?
python

print(2 + 3 * 5)
o a) 25
o b) 17
o c) 15
o d) 12
4. Which of the following is NOT a type of Artificial Intelligence?
o a) Reactive machines
o b) Limited memory
o c) Self-aware AI
o d) Machine Learning
5. Which of the following is NOT a domain of AI?
o a) Data
o b) Computer Vision
o c) NLP (Natural Language Processing)
o d) Information
6. What is one of the features of Python?
o a) Python is a compiled language
o b) Python is an interpreted language
o c) Python does not support loops
o d) Python is only used for web development
7. Which function is used to take user input in Python?
o a) input()
o b) get()
o c) read()
o d) user()
8. What is the return type of the following expression in Python?
python

len("Hello")
o a) String
o b) Boolean
o c) Integer
o d) List
9. Which of the following refers to the simulation of human
intelligence by machines?
o a) Intelligence
o b) Processing the data
o c) Artificial Intelligence
o d) Machine
10. In the AI Project Cycle, what does 'Model Evaluation' mean?
 a) Collecting more data
 b) Testing the performance of the AI model
 c) Pre-processing the data
 d) Making predictions
Section B: True and False
1. AI systems can perform tasks that typically require human
intelligence.
True/False
2. In Python, the 'else' block is executed when the condition in an
'if' statement is true.
True/False
3. In the AI Project Cycle, "Model Deployment" refers to putting
the trained model into production.
True/False
4. Python does not support object-oriented programming (OOP).
True/False
5. Data Pre-processing is the final step in the AI Project Cycle.
True/False

Section C: Python Programs


1. Write a Python program to print the sum of the first 10 natural
numbers using a loop.
2. Write a Python program to check if a number is even or odd
using an if-else statement.
3. What will be the output of the following algorithm if A = 20, B
= 30, C = 70?
(Assume the algorithm is not provided, but practice with sample
algorithms from the notes.)
4. Write a Python program to find the largest number among three
numbers entered by the user.
5. Write a Python program to find the greater value from the set of
numbers: -12, 15, 17.

Section D: One Word Answer


1. What does AI stand for?
2. What does NLP stand for?
3. Which keyword in Python is used to take input from the user?
4. Which keyword in Python is used to give output?
5. What is the purpose of the elif statement in Python?
Section E: Short Answer Questions
1. Define Artificial Intelligence (AI). Give two examples of AI in
everyday life.
2. Explain the difference between Sequential and Selective
statements in Python.
3. Explain 3 different shapes used in flowcharts.
4. Write an algorithm to input an age and check whether the person
is eligible for a driving license or not.
5. Draw a flowchart to check eligibility for a driving license.

Section F: Long Answer Questions


1. Write in detail about the types of Data Types in Python with
examples.
2. What is the purpose of comments in Python? How can we use
comments in Python? Give an example and provide details about
two different types of comments available in Python.
3. Discuss the advantages and disadvantages of flowcharts and
algorithms.
4. What are the main concepts of Artificial Intelligence (AI)?
Discuss at least four of them and explain how they contribute to
making machines intelligent.
5. Explain the concept of if-else statements in Python. Provide
an example where it can be used to check whether a number is
positive or negative.
6. What is sequential flow in programming? Explain with an
example.
7. Write and explain a Python program that takes a user input and
checks whether the input is a prime number or not.
Answer Key

Section A: Multiple Choice Questions (MCQs)

1. Which of the following is an example of Artificial


Intelligence?
o b) Self-driving car
2. What is the keyword used to define a function in Python?
o c) def
3. What will be the output of the following code in Python?

python

print(2 + 3 * 5)

o b) 17 (Because of operator precedence, multiplication is


performed first.)
4. Which of the following is NOT a type of Artificial
Intelligence?
o d) Machine Learning (Machine Learning is a subset of
AI, not a type of AI.)
5. Which of the following is NOT a domain of AI?
o d) Information
6. What is one of the features of Python?
o b) Python is an interpreted language
7. Which function is used to take user input in Python?
o a) input()
8. What is the return type of the following expression in
Python?

python

len("Hello")

o c) Integer (It returns the length of the string, which is an


integer.)
9. Which of the following refers to the simulation of human
intelligence by machines?
o c) Artificial Intelligence
10. In the AI Project Cycle, what does 'Model Evaluation'
mean?

 b) Testing the performance of the AI model

Section B: True and False

1. AI systems can perform tasks that typically require human


intelligence.
True
2. In Python, the 'else' block is executed when the condition in
an 'if' statement is true.
False (The else block executes when the condition in the if
statement is false.)
3. In the AI Project Cycle, "Model Deployment" refers to
putting the trained model into production.
True
4. Python does not support object-oriented programming
(OOP).
False (Python supports object-oriented programming.)
5. Data Pre-processing is the final step in the AI Project Cycle.
False (Data Pre-processing is an early step in the AI Project
Cycle.)

Section C: Python Programs

1. Write a Python program to print the sum of the first 10


natural numbers using a loop.

python
total = 0
for i in range(1, 11):
total += i
print("Sum of the first 10 natural numbers:", total)

2. Write a Python program to check if a number is even or odd


using an if-else statement.

python

num = int(input("Enter a number: "))


if num % 2 == 0:
print("The number is even.")
else:
print("The number is odd.")

3. What will be the output of the following algorithm if A = 20,


B = 30, C = 70?
(Note: Algorithm should be provided to solve the problem)
4. Write a Python program to find the largest number among
three numbers entered by the user.

python

num1 = int(input("Enter first number: "))


num2 = int(input("Enter second number: "))
num3 = int(input("Enter third number: "))

largest = max(num1, num2, num3)


print("The largest number is:", largest)

5. Write a Python program to find the greater value from the


set of numbers: -12, 15, 17.

python

numbers = [-12, 15, 17]


print("The greatest number is:", max(numbers))
Section D: One Word Answer

1. What does AI stand for?


Artificial Intelligence
2. What does NLP stand for?
Natural Language Processing
3. Which keyword in Python is used to take input from the
user?
input()
4. Which keyword in Python is used to give output?
print()
5. What is the purpose of the elif statement in Python?
The elif statement allows multiple conditions to be checked
in sequence after an initial if statement.

Section E: Short Answer Questions

1. Define Artificial Intelligence (AI). Give two examples of AI


in everyday life.
Artificial Intelligence (AI) is the simulation of human
intelligence processes by machines. Examples include:
o Self-driving cars
o Voice assistants like Siri or Alexa
2. Explain the difference between Sequential and Selective
statements in Python.
o Sequential statements are executed in the order they are
written, one after the other.
o Selective statements (like if, elif, else) allow the
program to choose between different paths based on
conditions.
3. Explain 3 different shapes used in flowcharts.
o Oval: Represents the start or end of the process.
o Rectangle: Represents a process or an action step.
o Diamond: Represents a decision point where the flow
can branch based on a condition.
4. Write an algorithm to input an age and check whether the
person is eligible for a driving license or not.
o Input the age.
o If age >= 18, print "Eligible for a driving license."
o Else, print "Not eligible for a driving license."
5. Draw a flowchart to check eligibility for a driving license.
(Flowchart representation: Decision box asking "Is age >=
18?" leading to two paths: Yes -> "Eligible" and No -> "Not
eligible")

Section F: Long Answer Questions

1. Write in detail about the types of Data Types in Python with


examples.
o Numeric types: Integer (int), Float (float), Complex
(complex). Example:

python

x = 5 # int
y = 3.5 # float
z = 2 + 3j # complex

o Sequence types: List (list), Tuple (tuple), String


(str). Example:

python

my_list = [1, 2, 3]
my_tuple = (4, 5, 6)
my_string = "Hello"

2. What is the purpose of comments in Python? How can we


use comments in Python?
o Comments are used to explain the code and make it
easier to understand. In Python, comments are created
using # for single-line comments and ''' or """ for
multi-line comments.

python

# This is a single-line comment


'''
This is a
multi-line comment
'''

3. Discuss the advantages and disadvantages of flowcharts and


algorithms.
o Flowcharts:
 Advantages: Easy to understand, good for
visualizing the process.
 Disadvantages: Can become complex for large
programs.
o Algorithms:
 Advantages: Precise and clear, independent of
any programming language.
 Disadvantages: Can be difficult to understand for
beginners.
4. What are the main concepts of Artificial Intelligence (AI)?
Discuss at least four of them.
o Machine Learning: Machines learn from data and
improve over time.
o Natural Language Processing (NLP): Enables
machines to understand and interact in human language.
o Computer Vision: Enables machines to interpret and
make decisions based on visual data.
o Robotics: AI-powered machines that can perform tasks
autonomously.
5. Explain the concept of if-else statements in Python.
Provide an example where it can be used to check whether a
number is positive or negative.

python
num = int(input("Enter a number: "))
if num > 0:
print("The number is positive.")
elif num < 0:
print("The number is negative.")
else:
print("The number is zero.")

6. What is sequential flow in programming? Explain with an


example.
o Sequential flow is when the program executes
instructions one after another in the order written.
Example:

python

print("Start")
print("Next step")
print("End")

7. Write and explain a Python program that takes a user input


and checks whether the input is a prime number or not.

python

num = int(input("Enter a number: "))


if num > 1:
for i in range(2, num):
if num % i == 0:
print("The number is not prime.")
break
else:
print("The number is prime.")
else:
print("The number is not prime.")

You might also like