top of page
Search

Module_4

  • Writer: Angela Porcelli
    Angela Porcelli
  • Feb 6, 2021
  • 1 min read

1.) Original data

Compute and print both roots of the quadratic equation x2-5.86 x+ 8.5408


In order to find the roots of the given quadratic equation, I first had to import cmath (mathematical functions for complex numbers). Then I assigned the numerical values in the given equation to the variables in the quadratic formula. These assigned values were then used in the discriminant formula, which I have explicitly defined. Cmath was then used to find the square roots.




2.) Original Data

Use a for loop to print the decimal representations of 1/2, 1/3, ..., 1/10, one on each line.


First, I assigned the elements to the variable 'Decimal'. Then, I wrote a for loop to be run over all elements of the Decimal variable. The print code requested that each decimal be returned on new line.






 
 
 

Recent Posts

See All
Final_Project

Problem description: The goal of graduating with a college degree is to have the ability to choose an employer that will provide an...

 
 
 

Comments


Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2021 by LIS 5937 - Python for Data Science Professions. Proudly created with Wix.com

bottom of page