• Complain

Ben Stephenson - The Python Workbook

Here you can read online Ben Stephenson - The Python Workbook full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 0, publisher: Springer International Publishing, Cham, genre: Romance novel. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Ben Stephenson The Python Workbook
  • Book:
    The Python Workbook
  • Author:
  • Publisher:
    Springer International Publishing, Cham
  • Genre:
  • Year:
    0
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

The Python Workbook: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "The Python Workbook" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Ben Stephenson: author's other books


Who wrote The Python Workbook? Find out the surname, the name of the author of the book and a list of all author's works by series.

The Python Workbook — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "The Python Workbook" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Part I
Exercises
Springer International Publishing Switzerland 2014
Ben Stephenson The Python Workbook
1. Introduction to Programming Exercises
Ben Stephenson 1
(1)
University of Calgary, Calgary, AB, Canada
Ben Stephenson
Email:
Keywords
Wind Speed Specific Heat Capacity Decimal Place Fuel Efficiency Regular Polygon
The exercises in this chapter are designed to help you develop your analysis skills by providing you with the opportunity to practice breaking small problems down into sequences of steps. In addition, completing these exercises will help you become familiar with Pythons syntax. To complete each exercise you should expect to use some or all of these Python features:
  • Generate output with print statements
  • Read input, including casting that input to the appropriate type
  • Perform calculations involving integers and floating point numbers using Python operators like + , - , * , / , // , % , and **
  • Call functions residing in the math module
  • Control how output is displayed using format specifiers
Exercise 1: Mailing Address
( Solved9 Lines )
Create a program that displays your name and complete mailing address formatted in the manner that you would usually see it on the outside of an envelope. Your program does not need to read any input from the user.
Exercise 2: Hello
( 9 Lines )
Write a program that asks the user to enter his or her name. The program should respond with a message that says hello to the user, using his or her name.
Exercise 3: Area of a Room
( Solved13 Lines )
Write a program that asks the user to enter the width and length of a room. Once the values have been read, your program should compute and display the area of the room. The length and the width will be entered as floating point numbers. Include units in your prompt and output message; either feet or meters, depending on which unit you are more comfortable working with.
Exercise 4: Area of a Field
( Solved15 Lines )
Create a program that reads the length and width of a farmers field from the user in feet. Display the area of the field in acres.
Hint: There are 43,560 square feet in an acre.
Exercise 5: Bottle Deposits
( Solved15 Lines )
In many jurisdictions a small deposit is added to drink containers to encourage people to recycle them. In one particular jurisdiction, drink containers holding one liter or less have a $0.10 deposit, and drink containers holding more than one liter have a $0.25 deposit.
Write a program that reads the number of containers of each size from the user. Your program should continue by computing and displaying the refund that will be received for returning those containers. Format the output so that it includes a dollar sign and always displays exactly two decimal places.
Exercise 6: Tax and Tip
( Solved17 Lines )
The program that you create for this exercise will begin by reading the cost of a meal ordered at a restaurant from the user. Then your program will compute the tax and tip for the meal. Use your local tax rate when computing the amount of tax owing. Compute the tip as 18 percent of the meal amount (without the tax). The output from your program should include the tax amount, the tip amount, and the grand total for the meal including both the tax and the tip. Format the output so that all of the values are displayed using two decimal places.
Exercise 7: Sum of the First Picture 1 Positive Integers
( Solved12 Lines )
Write a program that reads a positive integer, Picture 2 , from the user and then displays the sum of all of the integers from 1 to The Python Workbook - image 3 . The sum of the first The Python Workbook - image 4 positive integers can be computed using the formula:
The Python Workbook - image 5
Exercise 8: Widgets and Gizmos
( 15 Lines )
An online retailer sells two products: widgets and gizmos. Each widget weighs 75 grams. Each gizmo weighs 112 grams. Write a program that reads the number of widgets and the number of gizmos in an order from the user. Then your program should compute and display the total weight of the order.
Exercise 9: Compound Interest
( 19 Lines )
Pretend that you have just opened a new savings account that earns 4 percent interest per year. The interest that you earn is paid at the end of the year, and is added to the balance of the savings account. Write a program that begins by reading the amount of money deposited into the account from the user. Then your program should compute and display the amount in the savings account after 1, 2, and 3 years. Display each amount so that it is rounded to 2 decimal places.
Exercise 10: Arithmetic
( Solved20 Lines )
Create a program that reads two integers, Picture 6 and Picture 7 , from the user. Your program should compute and display:
  • The sum of Picture 8 and Picture 9
  • The difference when Picture 10 is subtracted from Picture 11
  • The product of Picture 12 and Picture 13
  • The quotient when Picture 14 is divided by Picture 15
  • The remainder when Picture 16 is divided by Picture 17
  • The result of Picture 18
  • The result of Picture 19
Hint: You will probably find the log10 function in the math module helpful for computing the second last item in the list.
Exercise 11: Fuel Efficiency
( 13 Lines )
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «The Python Workbook»

Look at similar books to The Python Workbook. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «The Python Workbook»

Discussion, reviews of the book The Python Workbook and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.