Exercises for Python coding

# Python Exercise Package

## An example of using `exbook`

The package `exbook` contains a number of coding exercise questions for you to practice. It can check your solution via a series of tests. You may follow the following steps to use `exbook`.

1. Install the package via running pip install exbook.

2. Import the package by the following code.

```from exbook import book as eb  # Import the exercise book from the exbook package
```
1. After importing the exercise book, we can use `eb[i]` to access each question in the exercise book. For example, the following code print the description of the first question `eb`.
```eb
```
``````Example(s):
``````
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
``````.dataframe tbody tr th {
vertical-align: top;
}

text-align: right;
}
``````
</style>
Input1 Input2 Output
0 3.5 2.7 6.2
``````Define a function with two strings to be the input arguments. The output is the summation of the numerical values of the input strings. For example, if the inputs are "3.5" and "2.7", then the output is 6.2.
?[1mLevel:?[0;0m easy
``````
1. You need to write a function according to the question description.
```"""Solution to the question"""
def sum_str(a, b):              # The function as the solution
return float(a) + float(b)  # Return the summation of numerical values
```
1. The last step is to run the method `check` of the question `eb`, then `exbook` would use a number of tests to check if your function is the correct solution to the exercise question.
```# Check if the function "sum_str" is a correct solution

eb.check(sum_str)
```
``````You passed 3 of the 3 tests.
The solution is correct
``````

If you cannot figure out the correct answer, you may set the argument `cheat` of the function `check` to be `True`, to display the information on why your solution is wrong.

```# Check the function "sum_str" and display the correct solutions

eb.check(sum_str, cheat=True)
```
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
``````.dataframe tbody tr th {
vertical-align: top;
}

text-align: right;
}
``````
</style>
Input1 Input2 Your output Correct output Correct
0 3.5 2.7 6.2 6.2 True
1 1.2 5 6.2 6.2 True
2 2 4 6.0 6 True
``````You passed 3 of the 3 tests.
The solution is correct
``````

There are totally 30 questions with different levels of difficulties in the module. You may now work on the other questions.

```len(eb)

eb
```
``````Example(s):
``````
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
``````.dataframe tbody tr th {
vertical-align: top;
}

text-align: right;
}
``````
</style>
Input1 Output
0 151 True
1 -5 True
``````Write a function to determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. For example, 121 is a palindrome so the output is True, 10 is not a palindrome so the output is False.
?[1mLevel:?[0;0m easy
``````
```len(eb)
```
``````30
``````

## Project details 0.0.3 0.0.2

This version 0.0.0

Uploaded `source`
Uploaded `py3`