0% found this document useful (0 votes)
60 views7 pages

Grade 9 Ai QP

Uploaded by

Dhinesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views7 pages

Grade 9 Ai QP

Uploaded by

Dhinesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Subject:Artificial

Term 1 Examination Date: 07-01-2022


Intelligence
Time: 10:00 pm - 1:00 pm Grade: 9 Max. Marks: 80

General Instructions:

The question paper is divided into 2 Sections - A and B.

Section A, consists of 30 Questions (1-30). Answer all the questions.

Section B, consists of 10 Questions (31-40). Answer all the questions.

Section-A
This section consists of 30 Questions (1 to 30). Attempt all the questions from this
section.
Choose the best possible option. 1X30=30
1. Python was created by ____________.
a) James Gosling
b) Steve Jobs
c) Guido van Rossum
d) Google

2. What is used to define a block of code (body of loop, function etc.) in Python?
a) Curly braces
b) Parenthesis
c) Indentation
d) Quotation

3. A Python paragraph comment uses the style ________.


a) // comments //
b) / comments /
c) ''' comments '''
d) /# comments #/

4. Which of the following statements is true?

1
a) Python is an interpreted language.
b) Python is a high level programming language.
c) Python is an object-oriented language.
d) All of the above.

5. What is the correct file extension for Python files?


a) .pyth
b) .pt
c) .pyt
d) .py

6. Which of the following is correct?


a) Python Interpreter ignores comment.
b) Comments are for programmers for better understanding of the program.
c) You can write multi-line comments in Python using triple quotes, either ''' or """.
d) All of the above

7. Is Python case sensitive when dealing with identifiers?


a) Yes
b) None of the above
c) No
d) machine dependent

8. What Python built-in function returns the unique number assigned to an object:
a) refnum()
b) id()
c) ref()
d) identity()

9. Which of the following is valid ?


a) _var = 'python'
b) __var = 'python'
c) _name_ = 'python'
d) All the above

10. Which of the following is not a keyword?


a) pass
b) class
c) max
d) Def

11. Select the correct output of the following code.

2
a) Python
b) 15
c) Blank
d) 15,Python

12. All keywords available in Python are in


a) Uppercase
b) Lowercase
c) Both uppercase and lowercase
d) CamelCase

13. Is Python case sensitive when dealing with identifiers?


a) Yes
b) None of the above
c) No
d) machine dependent

14. What is the output of the following code?

a) 70
b) 63
c) 152530
d) TypeError: unsupported operand type(s) for +: 'int' and 'str'

15. What gets printed?

a) abb abb
b) abb 2
c) 2
d) Error

16. In order to store values in terms of key and value which core data type is used.

3
a) list
b) tuple
c) class
d) Dictionary

17. What gets printed?

a) <class 'int'>
b) <class 'list'>
c) <class 'tuple'>
d) <class 'dict'>

18. What error occurs when you execute the following Python code snippet?

a) SyntaxError
b) NameError
c) ValueError
d) TypeError

19. What data type is the object below?

a) list
b) dictionary
c) array
d) Tuple

20. What is the output of the following code?

a) <class 'tuple'>
b) <class 'int'>
c) <class 'complex'>
d) <class 'list'>

21. What is the output of the following addition (+) operator


a = [10, 20]
b=a
b += [30, 40]
print(a)
print(b)

4
a) [10, 20, 30, 40]
[10, 20, 30, 40]
b) [10, 20]
[10, 20, 30, 40]
c) [10, 20, 10, 20]
[10, 20, 30, 40]
d) [10, 20]
[30, 40]

22. What is the value of the expression 100 / 25?


a) 4
b) 4.0
c) 0
d) 25

23. Which one of these is floor division?


a) //
b) /
c) %
d) None of the above

24. What is the order of precedence in python?


i) Parentheses
ii) Exponential
iii) Multiplication
iv) Division
v) Addition
vi) Subtraction
a) ii,i,iii,iv,v,vi
b) ii,i,iv,iii,v,vi
c) i,ii,iii,iv,vi,v
d) i,ii,iii,iv,v,vi

25. What is the output of the following code


x=6
y=2
print(x ** y)
print(x // y)
a) 66
0
b) 36
0
c) 66
3
d) 36
3

5
26. What is the output of the following code: print (9//2)
a) 4
b) 4.5
c) 4.0
d) Error

27. Which of the following is not a valid variable name in Python?


a) _var
b) var_name
c) var11
d) 5var

28. In Python, a variable must be declared before it is assigned a value:


a) True
b) False

29. Which of the following is a valid variable?


a) var@
b) 32var
c) in
d) abc_x

30. In which data type, indexing is not valid?


a) List
b) String
c) Dictionary
d) None of the above

Section-B
This section consists of 10 Questions (31 to 40). Attempt all questions from this
section.
Long answer 10X5=50
31. Explain the following with an example.
a) Interactive mode
b) Script mode
32. Explain Python character sets with example
33. Explain the following
a) Identifier and it’s rules
b) Keywords and it’s rules
34. Explain the following with an example.

6
a) Implicit conversion
b) Explicit conversion
35. Explain the following with an example.
a) Numeric data types
b) List data type
36. Explain the following with an example.
a) String data type
b) Tuple data type
c) Dictionary data type
37. Explain the following with an example.
a) Boolean data type
b) Dictionary data type
38. Explain the following with an example.
a) Mutable data type
b) Immutable data type
39. Explain the following with an example.
a) Arithmetic operators
b) Relational operators
40. Explain the following with an example.
a) Logical operators
b) Operators precedence

You might also like