equal
deleted
inserted
replaced
|
1 Objective Questions |
|
2 ------------------- |
|
3 |
|
4 .. A mininum of 8 questions here (along with answers) |
|
5 |
|
6 1. Why do we do Software Testing? |
|
7 |
|
8 Answer: To evaluate a program and determine that it meets required results. |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 2. What is proper indentation for python code according to style guidelines? |
|
14 |
|
15 Answer: Four Space Indentation |
|
16 |
|
17 3. What is the idiom used for running python scripts in a standalone manner? |
|
18 |
|
19 Answer: |
|
20 if __name__ == '__main__': |
|
21 |
|
22 4. What constitutes a test case? |
|
23 |
|
24 Answer: A set of inputs and expected result |
|
25 |
|
26 5. How do you start the debugger on ipython? |
|
27 |
|
28 Answer: %debug |
|
29 |
|
30 6. What idiom do you use for catching and exception? |
|
31 |
|
32 Answer: try,catch. |
|
33 |
|
34 7. What kind of exception is 0/0? |
|
35 |
|
36 Answer Zero Division Error |
|
37 |
|
38 8. a = 12.68 |
|
39 b = 0.05 |
|
40 c = round(a/b) |
|
41 d = c * b |
|
42 |
|
43 What would you recommend to the programmer who wrote |
|
44 above written piece of code. |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 Larger Questions |
|
52 ---------------- |
|
53 |
|
54 .. A minimum of 2 questions here (along with answers) |
|
55 |
|
56 1. Write a program for checking if two numbers are coprime |
|
57 Create test cases for it and automate it. |
|
58 2. Write a program that divides two numbers. Take the numbers from the user. Also make sure the code tell the user that input is invalid incase the divisor is 0. |
|
59 |
|
60 |