These Class 10 AI Important Questions Chapter 8 Python Conditional and Looping Statements Class 9 AI Important Questions and Answers NCERT Solutions Pdf help in building a strong foundation in artificial intelligence.
Python Conditional and Looping Statements Class 9 Important Questions
Class 9 AI Python Conditional and Looping Statements Questions
Important Questions of Python Conditional and Looping Statements Class 9 – Class 9 Python Conditional and Looping Statements Important Questions
Python Conditional and Looping Statements Class 9 AI Very Short Answer Type Questions
Question 1.
What is the minimum number of iterations that while loop could make?
Answer:
While loop could make minimum 0 iteration.
Question 2.
Explain entry controlled loop.
Answer:
In an entry controlled loop, the loop control condition is evaluated at the entry point of the loop.
Question 3.
Define iteration.
Answer:
Iteration is a process of executing a statement or a set of statements repeatedly, until some specific condition is specified.
Question 4.
Define sequence statement.
Answer:
Sequence statements refer to the instructions that are executed in the sequence in which they are written in the program.
![]()
Question 5.
What is looping?
Answer:
Looping is also iteration. It is the ability to perform the same set of operations repeatedly till a specific condition is met.
Question 6.
Explain selection statement.
Answer:
The sélection statement means the execution of statements depending upon a test condition.
Question 7.
What is the body of loop and exit condition?
Answer:
The set of statements repeated again and again is called body of loop and the condition on which the exit of the loop depends, is known as exit condition.
Question 8.
Write the purpose of for loop.
Answer:
The for loop is used for fixed number of iterations.
Question 9.
Give the output for the following program segment given below.
![]()
Answer:
The program segment does not produce any output.
Question 10.
Find the output of the following code.

Answer:
Output
1
2
4
Question 11.
Write an appropriate loop for the condition-A loop is to be repeated 100 times.
Answer:
for i in range (0,100,1) :
![]()
Question 12.
List the two looping structures.
Answer:
(i) for loop
(ii) while loop
Python Conditional and Looping Statements Class 9 AI Short Answer Type Questions
Question 1.
Write two different forms of if statement.
Answer:

Question 2.
Find the syntax error in the following program and underline after correct them.

Answer:
Correct code is

Question 3.
Construct logical expressions to represent the following conditions.
(i) Weight is greater than or equal to 115 but less than 125.
(ii) Donation is in the range of 4000-5000 or Guest is 1.
Answer:
(i) (weight >=115 and weight <125 )
(ii) ((Donation >=4000 and Donation <=5000 ) or Guest ==1 )
Question 4.
Write a Python program to calculate simple interest and display it.
Answer:

Output
Enter the principal : 5000
Enter rate of interest : 10
Enter time: 2
The simple interest is 1000.0
Question 5.
Write a program to input three angles and determine if they make a triangle or not.
Answer:

Output
Enter first angle : 45.6
Enter second angle : 44.4
Enter third angle : 90.0
These angles will make a triangle
Python Conditional and Looping Statements Class 9 AI Long Answer Type Questions
Question 1.
Write a program to generate and print
(i) all odd numbers from 1 to 20.
(ii) numbers 5,10,15 and 50 only till 50.
Answer:
(i)

Output
The odd number from 1 to 20
135791113151719
(ii)

Output
The numbers from 5 to 50 with 5 intervals
5 10 15 20 25 30 35 40 45 50
![]()
Question 2.
Write a program to check whether a number is prime or not.
Answer:

Output
Enter the number : 67
n = 67
67 is a prime number
Question 3.
Write a program to display a triangle of numbers using for loop within a while loop.
Answer:

Output
2
33
444
5555
66666
Question 4.
An electricity board charges according to the following rules.
For the first 100 units – 40 P per unit
For the next 200 units – 50 P per unit
Beyond 300 units -60 P per unit
All users have to pay meter charge also, which is ₹ 50. Write a program to read the number of units consumed and print out the charges.
Answer:

Output
Enter the number of units consumed: 125
The charges is: 102.5
Question 5.
Write a Python program to input the marks of 5 subjects and print their sum and average. Also, find the grade according to given conditions
| Average | Grade |
| >=90 and <=100 | A+ |
| >=81 and <=90 | A |
| >=71 and <=80 | B+ |
| >=61 and <=70 | B |
| >=51 and <=60 | C+ |
| >=41 and <=50 | C |
| >=0 and <=40 | F |
Answer:

The post Python Conditional and Looping Statements Class 9 AI Questions and Answers appeared first on Learn CBSE.
from Learn CBSE https://ift.tt/lKWAX7B
via IFTTT
No comments:
Post a Comment