# Numbers

## Exercise 1 - Creating formulas
Write the following mathematical formula in Python:

\begin{align}
 result = 6a^3 - \frac{8b^2 }{4c} + 11
\end{align}



```python
a = 2
b = 3
c = 2
```


```python
# Your formula here:
result = 
```


```python
## Run this cell to verify your code.             ##
## This is a test cell for the Excercise 1 Cell   ##
## Please do not modify the contents of this cell ##
## These are the test cases your code should pass ##

assert result == 50

print("All Passed!")
###################################################

```

## Exercise 2 - Floating point pitfalls
Show that `0.1 + 0.2 == 0.3`


```python
# Exercise 2 - code cell

# Your code here

# This won't work:
# assert 0.1 + 0.2 == 0.3
```

## Exercise 3

Make changes to this code to ensure that one of the print statements always executes


```python
# Exercise 3 - code cell

number1 = int(input('enter number ')) # type casting user input from str to int
number2 = int(input('enter number '))

if(number1>number2):
    if(number1//number2 > number1>number2):
        print("make sure this statement is always printed") 
else:
     if(number1//number2 < number1>number2):
        print("make sure this statement is always printed")
```

## Exercise 4

Understand the difference between / and // operators


```python
number1 = float(input('enter number ')) # type casting user input from str to float
number2 = float(input('enter number '))

## try inputs - 6,3 and 3,6

print('final result ',(number1/number2)/(number1//number2))
```

## Exercise 5

Understand how the modulus (%) operator works


```python
number1 = float(input('enter number '))
number2 = float(input('enter number '))

## try inputs - 6,3 and 3,6

print('final result ',(number1/number2)/(number1%number2))
```

0d01ed0f111755a42c4707a30b61f60ed7a385c9
ipynb
Jupyter Notebook
Basic Python/Worksheets/01_Numbers_Worksheet.ipynb
Atif0604/PythonForMachineLearning
f615ccabf32049c9d40fd5670036c8051c173bee
Apache-2.0
2020-04-08T05:41:40.000Z
2020-07-26T16:49:20.000Z
Basic Python/Worksheets/01_Numbers_Worksheet.ipynb
Mann0102/PythonForMachineLearning
f615ccabf32049c9d40fd5670036c8051c173bee
Apache-2.0
Basic Python/Worksheets/01_Numbers_Worksheet.ipynb
Mann0102/PythonForMachineLearning
f615ccabf32049c9d40fd5670036c8051c173bee
Apache-2.0
2020-04-09T11:01:05.000Z
2020-09-30T18:31:18.000Z
Qwen/Qwen-72B
1. YES
2. YES