equal
deleted
inserted
replaced
|
1 # round using int |
|
2 n = 17.3 # any float |
|
3 int (n + .5) |
|
4 |
|
5 # round it off to first decimal place |
|
6 round(amount * 10) / 10.0 |
|
7 |
|
8 # round it off to nearest 5 paise |
|
9 round(amount * 20) / 20.0 |
|
10 |
|
11 # exchange two variables |
|
12 a, b = b, a |