Page 304 - Ai_C10_Flipbook
P. 304
7. The function ………………………. is used to specify the values of the y-axis in Matplotlib.
8. A NumPy array can have multiple dimensions, where a two-dimensional array is called a ………………………..
SECTION B (Subjective Type Questions)
Short answer type questions.
1. Find out the errors in the given code.
a. “abc”=name
b. print(“hello class)
c. n=input(enter a number)
d. n1=10,n2=20
e. 20/10=a
f. a+b=c
g. num=int(input(enter your name)
2. Which of the following identifiers are invalid? Give reasons.
a. else b. My house c. #number
d. Class1 e. firstname f. Full Name
g. Rollno
3. What is the purpose of the scipy.optimize module in SciPy, and name one function it provides?
4. What is the purpose of the "plt.xticks()" function in Matplotlib?
5. What is the difference between a NumPy array and a Python list in terms of memory efficiency and mathematical
operations?
21 st Century #Technology Literacy
Skills
Lab
Write a Python code for the following.
a. Input radius and calculate the area and circumference of a circle.
b. To find the average of 3 numbers.
c. Print the highest of three numbers entered.
d. Print the even numbers between 21–50.
e. Print “HELLO” in reverse order.
f. Input age and check whether eligible for driving or not.
g. Input 5 numbers and print its sum.
h. Input a number and print your name that many times.
Answers
Exercise (Section A)
A. 1. b 2. b 3. d 4. b 5. b 6. b 7. c 8. d 9. a 10. b
B. 1. Navigator 2. Kernel 3. cell 4. enter key 5. Single line comment
6. loop 7. NumPy arrays 8. scatter 9. linear algebra
302 Artificial Intelligence Play (Ver 1.0)-X

