Hey guys, I love to give computer geeks challenges every week. Heres one of them.
Create a program that inputs two numbers from the user. The first number will be an integer; the second number could have decimals. If the first number is 1, the output will be the square of the second number. If the first number is 2, the output will be the square root of the second number (both rounded to one decimal place).
- You will need to import the Math library of functions by putting this line at the beginning of your program:
- In order to input decimals, you should convert to input() value to a floating decimal number instead of an integer. Here is how the input line might look:
This is how it would look like