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

CS 9 Oqb3 2425 Sa (Ai-Python)

This document is a question bank for Class IX Computer Science at Delhi Public School Surat, focusing on Python and Artificial Intelligence. It contains multiple-choice questions covering various aspects of Python programming, including syntax, data types, operators, and functions. The document also includes an answer key for the questions provided.

Uploaded by

ronanbhatia4
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)
14 views7 pages

CS 9 Oqb3 2425 Sa (Ai-Python)

This document is a question bank for Class IX Computer Science at Delhi Public School Surat, focusing on Python and Artificial Intelligence. It contains multiple-choice questions covering various aspects of Python programming, including syntax, data types, operators, and functions. The document also includes an answer key for the questions provided.

Uploaded by

ronanbhatia4
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

Series: DPSS/CS/OQB3/24-25

DELHI PUBLIC SCHOOL SURAT


COMPUTER SCIENCE OBJECTIVE QUESTION BANK-3
Chapter: Artificial Intelligence - Python Class: IX - ____
Name: _________________________________ Roll Number: __

1. Who created Python?


A. James Gosling C. Bjarne Stroustrup
B. Guido van Rossum D. Dennis Ritchie

2. When was Python first released?


A. 1989 C. 1995
B. 1991 D. 2000

3. Where was Guido van Rossum working when he created Python?


A. Google C. Centrum Wiskunde & Informatica (CWI)
B. MIT D. Stanford University

4. Which of the following is NOT a feature of Python?


A. It is platform independent. C. It has a simple syntax.
B. It is a compiled language. D. It is case sensitive.

5. Python is a(n) _______ language.


A. Easy to learn high-level C. Complex to learn
B. Platform dependent D. Assembly

6. Which statement is true about Python?


A. Python is case insensitive. C. Python is only available for Windows.
B. Python is an interpreted language. D. Python must be purchased for commercial use.

7. What does it mean that Python is a "platform independent" programming language?


C. Python must be compiled for each platform
A. Python can only be used on Windows.
separately.
B. Python code can run on any machine and operating D. Python does not support cross-platform code
system. execution.

8. Python's syntax can be described as:


A. Complex and verbose C. Similar to C++
B. Simple and easy to understand D. Case insensitive

DELHI PUBLIC SCHOOL SURAT Page 1 of 7


9. Which of the following features of Python makes it accessible and usable for both beginners and
experienced programmers?
A. High cost of usage C. Free to use and simple syntax
B. Complex syntax D. Limited platform support

10. Python being "free for commercial redistribution" means:


C. You can use Python for free but not distribute it
A. You must pay to use Python commercially.
commercially.
B. You can use and distribute Python commercially
D. Only non-commercial use of Python is free.
without paying.

11. Which of the following is NOT an application of Python programming?


C. Develop artificial intelligence based
A. Build a website
applications
B. Program robots D. Design computer hardware

12. Which of the following can be developed using Python?


A. Games C. Operating systems
B. Word processors D. Web browsers

13. Python can be used to perform which of the following?


A. Develop embedded systems C. Write low-level device drivers
B. Perform scientific computations D. Create video editing software

14. In the context of Python programming, what are variables?


A. Fixed values in memory C. Methods to compile code
B. Named storage locations in the computer memory D. Functions that perform specific tasks

15. What happens when a new value is stored in a Python variable?


A. The previous value is appended C. The previous value gets overwritten
B. The variable name is changed D. The variable is deleted

16. Which of the following applications is Python suitable for?


A. Building websites C. Writing BIOS firmware
B. Developing low-level operating system components D. Developing desktop icons

17. What can be inferred about variables in Python?


A. A variable can store multiple data values at a time. C. Variables are not case sensitive.
D. Variables must always be declared with a
B. A variable can store only one data value at a time.
specific data type.

18. Which of the following is an application of Python in robotics?


A. Developing microcontroller firmware C. Building robotic hardware
B. Program robots D. Creating 3D models of robots

19. What is the role of variables in Python?


A. To execute code C. To compile programs
B. To store data D. To display output

DELHI PUBLIC SCHOOL SURAT Page 2 of 7


20. Which field can benefit from Python's capability to develop artificial intelligence-based applications?
A. Marine biology C. Financial analysis
B. Graphic design D. Electrical engineering

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


A. 1variable C. _variable1
B. variable-name D. variable@name

22. What characters can a Python variable name consist of?


A. Letters, digits, and underscores C. Letters and digits only
B. Letters, digits, underscores, and hyphens D. Letters only

23. Which of the following cannot be used as a variable name in Python?


A. my_var C. class
B. var_1 D. _variable

24. Is the variable name "Age" the same as "age" in Python?


A. Yes
B. No

25. Which of these variable names is invalid in Python?


A. user_name C. user1name
B. _username D. user-name

26. What is the maximum length of a variable name in Python?


A. 31 characters C. 255 characters
B. 63 characters D. No limit

27. Can a Python variable name start with a digit?


A. Yes
B. No

28. Which of the following variable names follows all the rules for valid identifiers in Python?
A. 99bottles C. bottle-99
B. bottle99 D. bottle@99

29. Can a Python variable name include special characters like @, $, or %?


A. Yes
B. No

30. Which of the following is true about variable names in Python?


A. Variable names are not case sensitive. C. Keywords can be used as variable names.
B. Variable names can start with a digit. D. Variable names can be of any length.

31. Which of the following is an example of an integer (int) data type in Python?
A. 3.14 C. -48.6
B. "20" D. 10

DELHI PUBLIC SCHOOL SURAT Page 3 of 7


32. Which of these values is of the float data type?
A. 100 C. 18.0
B. "3.14" D. True

33. What data type would be used to store a student's address in Python?
A. int C. str
B. float D. bool

34. Which of the following is NOT a valid example of a string (str) data type?
A. "Hello" C. 12345
B. '218' D. 'Peace'

35. What data type represents logical values in Python?


A. int C. str
B. float D. bool

36. Which of the following values is considered as False in a boolean context in Python?
A. 1 C. -1
B. 0 D. 2.5

37. Which function is used to print a message or value on the console in Python?
A. input() C. print()
B. write() D. display()

38. What will be the output of the following code: print("Hello, World!")?
A. Hello, World C. "Hello, World!"
B. Hello, World! D. Hello, World

39. What is the correct syntax to print multiple values in Python using the print() function?
A. print("Value1", "Value2") C. print("Value1" "Value2")
B. print("Value1"; "Value2") D. print(Value1 + Value2)

40. Which of the following statements about the print() function is true?
C. The print() function is used to display output on
A. The print() function can only print strings.
the console.
D. The print() function is used to read input from
B. The print() function cannot take multiple parameters.
the user.

41. What is the default data type of the value returned by the input() function in Python?
A. int C. str
B. float D. bool

42. How can you convert the user input to an integer in Python?
A. int.input() C. int(input())
B. input.int() D. input(int())

DELHI PUBLIC SCHOOL SURAT Page 4 of 7


43. Which of the following code snippets correctly accepts a floating-point number from the user?
A. float(input("Enter a number: ")) C. input("Enter a number: ").float()
B. input(float("Enter a number: ")) D. float("Enter a number: ")

44. What is the purpose of the input() function in Python?


A. To display output on the console C. To perform mathematical calculations
B. To accept input from the user D. To convert data types

45. Which function can be used along with input() to ensure the input value is treated as an integer?
A. str() C. bool()
B. float() D. int()

46. How can you ensure that the value entered by the user is treated as a floating-point number in Python?
A. Use float() function with input() C. Use str() function with input()
B. Use int() function with input() D. Use bool() function with input()

47. Which of the following is true about the input() function in Python?
C. It can be used with int() and float() to accept
A. It can only accept string input from the user.
numerical input.
B. It returns the input as an integer by default. D. It cannot be used to accept input from the user.

48. How would you correctly read an integer input from the user and store it in a variable called number?
A. number = input(int("Enter a number: ")) C. number = input("Enter a number: ").int()
B. number = int(input("Enter a number: ")) D. number = int("Enter a number: ")

49. Which arithmetic operator is used to add two numbers in Python?


A. - C. /
B. * D. +

50. What will be the result of the following expression in Python: 45 - 35?
A. 80 C. -10
B. 10 D. 20

51. Which operator is used to multiply two values in Python?


A. / C. *
B. - D. +

52. What is the result of the expression 5 / 2 in Python?


A. 2.0 C. 2
B. 2.5 D. 3

53. How does floor division differ from regular division in Python?
C. It returns the largest integer less than or equal to
A. It returns the decimal part of the division.
the division.
B. It returns the smallest integer greater than the
D. It returns the remainder of the division.
division.

54. What is the output of the expression 10.0 / 3 in Python?


A. 3 C. 3.33
B. 3.0 D. 3.3333333333333335

DELHI PUBLIC SCHOOL SURAT Page 5 of 7


55. Which operator is used to find the remainder of a division in Python?
A. // C. **
B. % D. /

56. What is the result of the expression 5 // 2 in Python?


A. 2.5 C. 2
B. 2.0 D. 3

57. Which of the following expressions correctly calculates 2 raised to the power of 3 in Python?
A. 2^3 C. 2^^3
B. 2**3 D. 2*3

58. What is the result of the expression 10 % 6 in Python?


A. 4 C. 2
B. 1 D. 0

59. What is the result of the expression 3 % 2 in Python?


A. 0 C. 2
B. 1 D. 3

60. Which arithmetic operator is used to perform exponentiation in Python?


A. ^ C. **
B. * D. //

61. Which of the following is a relational operator in Python?


A. + C. ==
B. * D. **

62. What will be the result of the expression 5 > 3?


A. 5 C. True
B. 3 D. False

63. Which operator is used to check if two values are equal in Python?
A. = C. !=
B. == D. <=

64. What is the result of the expression 10 != 5?


A. True C. 10
B. False D. 5

65. Which relational operator checks if the left operand is greater than or equal to the right operand?
A. > C. >=
B. < D. <=

66. What will be the result of the expression 7 <= 7?


A. True C. 7
B. False D. None

DELHI PUBLIC SCHOOL SURAT Page 6 of 7


67. Which operator is used to check if two values are not equal in Python?
A. = C. !=
B. == D. <=

68. What does the expression 15 < 20 evaluate to?


A. 15 C. True
B. 20 D. False

69. What will be the result of the expression 9 >= 10?


A. True C. 9
B. False D. 10

70. Which relational operator is used to check if the left operand is less than the right operand?
A. > C. >=
B. < D. ==

71. What is the result of the expression 8 == 8?


A. True C. 8
B. False D. None

72. Which relational operator will evaluate to True for the expression 5 != 3?
A. == C. >
B. < D. !=

73. Which of the following is a logical operator in Python?


A. == C. +
B. and D. /

ANSWERS
1.B 2.B 3.C 4.B 5.A 6.B 7.B 8.B 9.C 10.B
11.D 12.A 13.B 14.B 15.C 16.A 17.B 18.B 19.B 20.C
21.C 22.A 23.C 24.B 25.D 26.D 27.B 28.B 29.B 30.D
31.D 32.C 33.C 34.C 35.D 36.B 37.C 38.B 39.A 40.C
41.C 42.C 43.A 44.B 45.D 46.A 47.C 48.B 49.D 50.B
51.C 52.B 53.C 54.D 55.B 56.C 57.B 58.A 59.B 60.C
61.C 62.C 63.B 64.A 65.C 66.A 67.C 68.C 69.B 70.B
71.A 72.D 73.B

DELHI PUBLIC SCHOOL SURAT Page 7 of 7

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy