Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please I need help with the result of this project copy and paste the sample code below into the Python programming app of your choice,

Please I need help with the result of this project

copy and paste the sample code below into the Python programming app of your choice, one program at a time. RUN THE PROGRAM to make sure it's working properly. IF YOU GET AN ERROR, please correct the error and run the program again to make sure it's working properly. NOTE: I ran all these programs successfully in Python 3.6 (32-bit)

Then, for EACH PROGRAM, make the asked-for changes and rerun the program. Correct any errors, so that you can turn in the assignment with no errors thrown.

I need a screen print of each changed program once you have run the program to make certain that it's working. Copy and paste your changed code into text, and submit that document as well. please thank you,

Write a Python program to calculate midpoints of a line.

PROGRAM: print(' Calculate the midpoint of a line :')

x1 = float(input('The value of x (the first endpoint) ')) y1 = float(input('The value of y (the first endpoint) '))

x2 = float(input('The value of x (the first endpoint) ')) y2 = float(input('The value of y (the first endpoint) '))

x_m_point = (x1 + x2)/2 y_m_point = (y1 + y2)/2 print(); print("The midpoint of line is :") print( "The midpoint's x value is: ",x_m_point) print( "The midpoint's y value is: ",y_m_point) print();

SAMPLE OUTPUT: Calculate the midpoint of a line : The value of x (the first endpoint) 2 The value of y (the first endpoint) 2 The value of x (the first endpoint) 4 The value of y (the first endpoint) 4 The midpoint of line is : The midpoint's x value is: 3.0 The midpoint's y value is: 3.0

Write a Python program to check if a string is numeric.

PROGRAM: str = 'a123' #str = '123' try: i = float(str) except (ValueError, TypeError): print(' Not numeric') print()

OUTPUT: Not numeric

Write a Python program to sum all counts in collections.

PROGRAM: import collections num = [2,2,4,6,6,8,6,10,4] print(sum(collections.Counter(num).values()))

OUTPUT: 9

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions

Question

pr 22(8)-3A A. Direct Materials Cost Variance

Answered: 1 week ago

Question

describe and present a summary of data you have collected.

Answered: 1 week ago

Question

collect, organise and store quantitative data in an effective way;

Answered: 1 week ago