322
|
1 |
Objective Questions
|
|
2 |
-------------------
|
|
3 |
|
|
4 |
.. A mininum of 8 questions here (along with answers)
|
|
5 |
|
|
6 |
1. How do you declare a sequence of numbers in python?
|
|
7 |
Give example .
|
|
8 |
|
|
9 |
Comma seperated numbers inside two square brackets.
|
|
10 |
|
|
11 |
seq=[1.5,3.2,8.7]
|
|
12 |
|
|
13 |
|
|
14 |
2. Square the following sequence?
|
|
15 |
|
|
16 |
distance_values=[2.1,4.6,8.72,9.03].
|
|
17 |
|
|
18 |
square(distance_values)
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
3. How do you plot points ?
|
|
23 |
|
|
24 |
By passing an extra parameter '.'.
|
|
25 |
|
|
26 |
4. What does the parameter 'o' do ?
|
|
27 |
|
|
28 |
It plots large points.
|
|
29 |
|
|
30 |
5. How do you plot error in Python?
|
|
31 |
|
|
32 |
Using the function error bar.
|
|
33 |
|
|
34 |
6. How do I get large red colour dots on a plot?
|
|
35 |
|
|
36 |
By passing the paramter 'ro'.
|
|
37 |
|
|
38 |
7. What are the parameters 'xerr' and 'yerr' in errorbar function for?
|
|
39 |
|
|
40 |
xerr - List of error values of variable on x axis.
|
|
41 |
yerr - List of error values of variable on y ayis.
|
|
42 |
|
|
43 |
8. How would you plot error bar with a line?
|
|
44 |
|
|
45 |
The fmt parameter for a line will be '-'.
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
Larger Questions
|
|
51 |
----------------
|
|
52 |
|
|
53 |
.. A minimum of 2 questions here (along with answers)
|
|
54 |
|
372
|
55 |
1. Plot an errorbar for following experimental data.
|
|
56 |
|
|
57 |
| X | Y | Xerr | Yerr |
|
|
58 |
| 154.9 | 8106 | 8.51 | 165.8 |
|
|
59 |
| 154.3 | 8138 | 8.50 | 166.3 |
|
|
60 |
| 148.7 | 8148 | 7.78 | 161.2 |
|
|
61 |
| 149.6 | 8171 | 7.81 | 162.6 |
|
|
62 |
|
|
63 |
in red colour with large dots
|
|
64 |
|
|
65 |
2. List the parameters for errorbar and their function?
|