Can you please make a simple python program? I will give you 20 points and branliest if it is good! It must include:
·At least 3 variables
·Contain a new function
·And must have at least 10 lines of code

Answers

Answer 1

Answer:

# Solve the quadratic equation ax**2 + bx + c = 0

# import complex math module

import cmath

a = 1

b = 5

c = 6

# calculate the discriminant

d = (b**2) - (4*a*c)

# find two solutions

sol1 = (-b-cmath.sqrt(d))/(2*a)

sol2 = (-b+cmath.sqrt(d))/(2*a)

print('The solution are {0} and {1}'.format(sol1,sol2))

Hope This Helps!!!

Answer 2

Answer:

# Newton's Law of Universal Gravitation

import math

print("This program will calculate the gravitational force between two objects")

# Gravitational Constant

G = 6.67408

while True:

   try:

       m1 = float(input("\nInput mass of first object (in kilograms): "))

       break

   except ValueError:

       print("Invalid input!")

while True:

   try:

       m2 = float(input("Input mass of second object (in kilograms): "))

       break

   except ValueError:

       print("Invalid input!")

while True:

   try:

       d = float(input("Distance between the objects (in meters): "))

       break

   except ValueError:

       print("Invalid input!")

force = G * (m1 * m2) / math.pow(d, 2)

print("The gravitational force between these two objects is {0} newtons!".format(force))


Related Questions

Other Questions
Ms. Tranquille is making a scale drawing of a famous building. In reality, the building is 108 meters tall. In her drawing, the building is [tex]4\frac{1}{2} [/tex]inches tall. How wide should the scale drawing be if the actual width is 48 meters?PLEASE HELP I WILL MARK YOU BRAINIEST Buying a house that you cannot afford __________________. (Choose all that apply) is a very responsible thing to do; it is a good investment can cause great stress in your life is a mistake and can strap you financially Is it ok to run if u have period Composing ________________ is another way to compose two functions Hi can someone may help me with this problem I'm struggling withASSP Which exercise involves a movement back behind the body? The process in which a gas turns back into a liquid is called __________. What word completes the sentence? $350 saved at 4.3 interest for 5 years Name two elements that are extracted fromtheir compounds by electrolysis. How many squares with a side of 3 cm can fit in a 12 cm by 3 cm rectangle HELP ASAP ILL GVIE BRAINLIEST TO THE CORRECT ANSWER I need help please!!!!! InstructionsGabriela and her family are on a Caribbean cruise and the ship has stopped in San Juan. Complete her e-mail with the correct forms of the present progressive. Selma deposited a paycheck for $378.42. shell use the check register to record her transaction. what will be her new balance? a checking account has a balance of 2636 dollars and 41 cents. $2,257.99 $2,337.06 $3,014.83 $3,057.31 the distibution on the condutor How can we increase the surface area of reactants?add a catalystO place them in a flamedissolve them in watero add more particles to the solution HELPP ME ITS BEEN SO LONG HELP PLEASEEE HELP PLEASEE HELPP Stevie needed twine for the gifts she was wrapping for a family party. The lengths of Stevies twine are shown on the line plot below. How many feet of twine does Stevie have total? The result of John Brown's raid on Harpers Ferry was Group of answer choices outrage and fear throughout the South. Northern anger at his actions. Northern abandonment of the Republican Party. Dramatic growth for the northern Democratic Party. Slave unrest in the South what is the interquartile rang of the following data set? 9,30,2,48,42,18,81,5,55,73,11 I NEED THIS ASAP PLEASE