Page 336 - Artificial Intellegence_v2.0_Class_9
P. 336
print ("Number is:", num)
print ("Thanks!")
7. 5=a
b=int(input(ENTER value for b))
if a<b
print('a is bigger")
Else:
print("b is bigger"
Ans. Correct code is:
a=5
b=int(input("ENTER value for b"))
if a<b:
print("a is bigger")
else:
print("b is bigger")
E. Solve the given expressions based on operator precedence:
1. 2 ** 5 – 35 // 3 2. not 15 < 2 or 2 ** 3 > 12/3
Ans. 32 – 11 Ans. not False or 8 > 12 / 3
21 not False or True
True or True
Tru
3. 6 * 5 – 14 // 7 + 2 ** 3 4. 50 // 9 - 2 * 5
Ans. 30 – 2 + 8 Ans. 5 - 2 * 5
36 5 - 10
5. 3 ** 3 + 10 – 22 // 2
Ans. 27 + 10 – 11
37 – 11
26
SECTION B (Subjective Type Questions)
A. Short answer type questions:
1. What is a Program?
Ans. The step-by-step instruction written in any programming language to do a specific task is known as a Program.
A program is written in any programming language which the computer can understand and execute.
2. What is CodeCombat?
Ans. CodeCombat is a free coding educational game that teaches you to learn JavaScript or Python coding in a fun way. It
is available for all age groups to suit the needs of all levels of coding and computer science learners.
3. What is the use of an arrow in flowchart?
Ans. It controls the direction of flow of instructions in a flowchart.
4. Name the steps involved in Computer Problem solving.
Ans. • Understanding the problem.
334 Touchpad Artificial Intelligence (Ver. 2.0)-IX

