Question

Intro to Python:

Q1:

Bonnie is writing a Python program for her math class so she can check her answers quickly. She is having some difficulties, however, because when she enters values like 3.5 or 2.71 her program throws an error. She has heard of your expertise in Python and asks for your help. What error is being thrown and how can she fix the program to accept values like 3.5 or 2.71?

from math import sgrt def distance (coorl, coor2): Accepts two tuples that represents points on a graph and calculates the d

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Error :

ValueError: invalid literal for int() with base 10: '3.5'

saved main.py https://Aggravating Idol ized Coderesource.rahulkumar29. first_cordinates = (input Enter first_cordinates: ).

Fix :

first_cordinates = [float(i) for i in first_cordinates]

second_cordinates = [float(i) for i in second_cordinates]

saved main.py http://Aggravating IdolizedCoderesource.rah first_cordinates = (input(Enter first_cordinates: ).split() secon

Add a comment
Know the answer?
Add Answer to:
Intro to Python: Q1: Bonnie is writing a Python program for her math class so she can check her answers quickly. She is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • INSTRUCTIONS: I NEED TO CREATE A PointApp PROGRAM THAT USES THE FOLLOWING API DOCUMENTATION. Below the...

    INSTRUCTIONS: I NEED TO CREATE A PointApp PROGRAM THAT USES THE FOLLOWING API DOCUMENTATION. Below the API Documentation is the code I submitted. However, the output is different for what they are asking. I am looking for someone to fix the code to print out the correct output and to add comments so I can have an idea in how the code works. PLEASE AND THANK YOU. API DOCUMENTATION: public class Point extends java.lang.Object The Point class is used to...

  • Java Help 2. Task: Create a client for the Point class. Be very thorough with your...

    Java Help 2. Task: Create a client for the Point class. Be very thorough with your testing (including invalid input) and have output similar to the sample output below: ---After declaration, constructors invoked--- Using toString(): First point is (0, 0) Second point is (7, 13) Third point is (7, 15) Second point (7, 13) lines up vertically with third point (7, 15) Second point (7, 13) doesn't line up horizontally with third point (7, 15) Enter the x-coordinate for first...

  • HHackerRank Spirinkle: Unfulfilled Orders Ms. Sugar has decided to use her spirinkle idea as a re...

    Please find an expert in algorithms to solve this problem HHackerRank Spirinkle: Unfulfilled Orders Ms. Sugar has decided to use her spirinkle idea as a regular option on the specials menu. To support this, she has purchased & spirinkle machines. There are n customers coming in to the store. The th customer (1く讠 n) places their order at time. requesting a spirinkle of size ky. These orders are to be processed on a 'first come first served basis, however not...

  • Calculator Project

    AssignmentYou will be designing a calculator complete with user interface to take input from the user, process a response, and produce the output.Step 1: Present a menuFirst thing you should do is present a menu to the user when your program is first ran. Make sure that the operations match the numbers presented below, otherwise the graders won't be able to grade your program.1. Cartesian distance 2. Vector x matrix 3. Normalize 4. Quit Enter command:You will present the menu and wait for the user to input their...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT