1 / 15

Sekvence za krmiljenje tiska

Sekvence za krmiljenje tiska. Primer izpisa. Primer izpisa. Understanding Operator Precedence. # To start with, all the measurements will be in cm # Assume that the roll of material is going to be 140cm wide # and that the price per meter will be 5 units of currency roll _ width = 140

herbst
Download Presentation

Sekvence za krmiljenje tiska

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sekvence za krmiljenje tiska

  2. Primer izpisa

  3. Primer izpisa

  4. Understanding Operator Precedence

  5. # To start with, all the measurements will be in cm # Assume that the roll of material is going to be 140cm wide # and that the price per meter will be 5 units of currency roll_width = 140 price_per_metre = 5 # Prompt the user to input the window measurements in cm window_height = input('Enter the height of the window (cm): ') window_width = input('Enter the width of the window (cm): ') # Add a bit for the hems # First we must convert the string into a number # otherwise we will get an error if we try to perform arithmetic on a text string curtain_width = float(window_width) * 0.75 + 20 curtain_length = float(window_height) + 15 # Work out how many widths of cloth will be needed # and figure out the total length of material for each curtain (in cm still) widths = curtain_width / roll_width total_length = curtain_length * widths # Actually there are two curtains, so we must double the amount of material # and then divide by 10 to get the number of meters total_length = (total_length * 2) / 10 # Finally, work out how much it will cost price = total_length * price_per_metre # And print out the result print("You need", total_length, "meters of cloth for ", price)

  6. MakingChoices

  7. Sample

More Related