Related questions with answers
Question
Implement a program that requests the user to enter the x and y coordinates (each between -10 and 10) of a dart and computes whether the dart has hit the dartboard, a circle with center (0; 0) and radius 8. If so, string It is in! should be printed on the screen.
>>>
Enter x: 2.5
Enter y: 4
It is in!
Solution
VerifiedAnswered 2 years ago
Answered 2 years ago
Step 1
1 of 2Because it's not defined whether the input will be an
integer or a float value, it's not possible to use the
function, but we can use the function instead of .
x = eval(input("Enter x: ")) y = eval(input("Enter y: "))
if x2 + y2 < 8**2: print("It is in!")
Create an account to view solutions
By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Create an account to view solutions
By signing up, you accept Quizlet's Terms of Service and Privacy Policy
More related questions
- algebra
- precalculus
- algebra
1/4
- algebra
- precalculus
- algebra
1/7