Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
bartleby

Concept explainers

Question
Book Icon
Chapter 11, Problem 1PE
Program Plan Intro

Modified statistics program

Program plan:

  • Import the necessary modules.
  • Define the “mean()” function,
    • Returns mean value to the caller.
  • Define the “StdDev()” function,
    • Returns standard deviation value to the caller.
  • Define the “meanStdDev()” function,
    • Returns average standard deviation value to the caller.
  • Define the “median()” function,
    • Returns median value to the caller.
  • Define the “main()” function,
    • Get comma separated values from the user.
    • Separate the value based on “,” using “split()”.
    • Create a “for” loop to iterate over comma separated values.
      • Assign the value.
        • Print the options.
        • Create sentinel loop to get numbers.
        • Prompts the user for the type of operation to perform.
        • Check whether the operation is “Avg” using “if” .
          • If it is true, print mean value return from “mean()” function.
        • Otherwise, check whether the operation is “Med” using “elif”.
          • If it is true, print median value return from “median()” function.
        • Otherwise, check whether the operation is “Std” using “elif”.
          • If it is true, print standard deviation return from “stdDev()” function.
        • Otherwise, check whether the operation is “AvgStd” using “elif”.
          • If it is true, print average standard deviation value return from “meanStdDev()” function.
        • Otherwise, check whether the operation is empty (‘ ‘)using “elif”.
          • If it is true, use “break” to exit.
          • Otherwise print “Please try again”.
  • Call the “main()” function.

Blurred answer
Students have asked these similar questions
who started the world wide web
Question No 1: (Topic: Systems for collaboration and social business The information systems function in business) How does Porter's competitive forces model help companies develop competitive strategies using information systems? • List and describe four competitive strategies enabled by information systems that firms can pursue. • Describe how information systems can support each of these competitive strategies and give examples.
Data communıcatıon digital data is transmitted via analog ASK and PSK are used together to increase the number of bits transmitted a)For m=8,suggest a solution and define signal elements , and then draw signals for the following sent data data = 0 1 0 1 1 0 0 0 1 0 1 1
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education