Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.98 KB | None | 0 0
  1. /*
  2. You will be supplied with two data files in CSV format. The first file
  3. contains statistics about various dinosaurs. The second file contains
  4. additional data.
  5.  
  6. Given the formula:
  7.  
  8. speed = ((STRIDE_LENGTH / LEG_LENGTH) - 1) * SQRT(LEG_LENGTH * g)
  9.     where g = 9.8 m/s^2 (gravitational constant)
  10.  
  11. write a program to read in the data files from disk, it must then print the
  12. names of only the bipedal (i.e. two-legged) dinosaurs from fastest to slowest. Do not print any
  13. other information.
  14.  
  15. $ cat dataset1.csv
  16. NAME,LEG_LENGTH,DIET
  17. Hadrosaurus,1.2,herbivore
  18. Struthiomimus,0.92,omnivore
  19. Velociraptor,1.0,carnivore
  20. Triceratops,0.87,herbivore
  21. Euoplocephalus,1.6,herbivore
  22. Stegosaurus,1.40,herbivore
  23. Tyrannosaurus Rex,2.5,carnivore
  24.  
  25. $ cat dataset2.csv
  26. NAME,STRIDE_LENGTH,STANCE
  27. Euoplocephalus,1.87,quadrupedal
  28. Stegosaurus,1.90,quadrupedal
  29. Tyrannosaurus Rex,5.76,bipedal
  30. Hadrosaurus,1.4,bipedal
  31. Deinonychus,1.21,bipedal
  32. Struthiomimus,1.34,bipedal
  33. Velociraptor,2.72,bipedal
  34. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement