when the user mistypes and enters something that is not an integer, can you capture the error and simply ask the user to repeat his input, until you get 2 correct integer numbers?
> >
when the user mistypes and enters something that is not a real number, can you capture the error and simply ask the user to repeat his input, until you get 2 correct floating point numbers?
Bonus points: Writing a parser for user input is rather easy if the numbers and operator are separated by spaces (have a look at the split method of strings). It is quite a bit more tricky if you allow entering calculations without spaces between the operands and the operator. Can you write a parser accomplishing this?
Line: 71 to 71
Write a script that asks the user for an angle in degrees. Calculate the sine of this angle.
Exercise 6: Classes
Changed:
< <
Write a Python class with methods calculation mathematical number series. These series should be calculated:
> >
Write a Python class with methods calculating mathematical number series. These series should be calculated:
The Fibonacci numbers up to F(n). n is passed as parameter to the method
The Fibonacci numbers smaller than max. max is passed as parameter to the method