1.
The following piece of Python code should produce output 5. What changes should be made to the code to achieve this?
class IntComparer(object):
    ""
"Class that compares two integers."
""

def __init__(self, x, y):
    self.x = x
self.y = y

def greater(self):
    ""
"Returns the greater integer."
""

if self.x < self.y:
    return self.x
else :
    return self.y

def smaller(self):
    ""
"Returns the smaller integer."
""

numbers = [self.x, self.y]
numbers.remove(self.greater())
return numbers[0]

comparer = IntComparer(5, 9)
print(comparer.smaller())# Output should be 5
2.
What is the output of the following Python code:
def func(x, y = 5, z = 10):
    print('x: ', x, 'y: '
        y, 'z: ', z)
1: func(5, 10)
2: func(5, z = 15)
3: func(z = 5, 10)
4: func(x = 5, z = 10)
3.
What is the output of the following Python code:
import re;
sentence = 'eagles are fast'
regex = re.compile('(?Pw+) (?Pw+) (?Pw+)')
matched = re.search(regex, sentence)
print(matched.groups())
4.
What is the output of the following Python code:
myArr = [4, 7, 7, 7, 7, 4]
max = myArr[0]
indexOfMax = 0
for z in range(1, len(myArr)):
    if myArr[z] > max:
    max = myArr[z]
indexOfMax = z
5.
What is the output of the following Python code:
def increment_items(length, increment):
    i = 0
while i < len(length):
    length[i] = length[i] + increment
i = i + 1
values = [1, 2, 3]
print(increment_items(values, 2))
print(values)
6.

What is the function of the following Git code:

$ git commit -m "Some message"
$ git reset --soft HEAD~
<< edit files as necessary >>
$ git add ...
$ git commit -c ORIG_HEAD
7.
In Git, if you have committed your code with an incorrect commit message, then which of the following commands is used to correct the commit message?
8.
In Git, you are defining a .gitmodules file for your project. You are required to define the path that is related to the top-level directory of a tree. This tree allows you to check the submodule. Which of the following commands will you use to achieve this task?
9.

You are configuring the submodule.<name>.update key in your .gitmodules file for your Git project. Which of the following parameters are you allowed to use in this case:


  1. Checkout
  2. Rebase
  3. Merge
  4. Clone
10.

In the following Git code, which of the following aliases can be used as an alternative:

git log -g --abbrev-commit --pretty=oneline