Page 339 - AI Ver 1.0 Class 9
P. 339
S. No Questions Answers
1 Which of the following variable names are invalid? Give ● 9thclass (Cannot begin with
reasons. number)
And ● My name (No spaces allowed)
9thclass ● # friends (No special character
My name allowed)
#friends ● Last$name (No special
character allowed)
False
_Rollno
_1number
Last$name
If
For
2 Which of the following are arithmetic operators? **
!= *
** //
or
//
+=
*
3 What is the output of the given statement? 3
print(20 // 3 + 2 - 5)
4 What is the output of the given statement? i)False
(a) (11-22>1+20) or (15//2 == 12/3) ii)False
(b) 11*2==(20-4//2) and (12-8)>(11*2)
5 Convert the given for loop into while loop: s=0
s=0 i=20
for i in range(20,10,-2): while i>10:
print(i, end=",") print(i, end=",")
s+=i s+=i
print(s) i-=2
print(s)
Python Practical Questions 337

