PY Practice X11

Source: Internet
Author: User

#-*-coding:cp936-*-

# Write a change procedure, require the user to enter the payment amount and the bill, the program is determined to find change for a few yuan, a few corners, a few !

Def YH ():

# Payment amount - bill = change ( remaining )

Q1=raw_input (' Please enter your payment amount as:')

Q2=raw_input (' Please enter your bill as:')

#q1 indicates the amount of payment entered

#q2 represents the bill entered

#q3 means change ( the rest )

Q1=int (Q1)

Q2=int (Q2)

print ' you need to pay the amount for %.2f:, need to give out this month's bill for %.2f '% (Q1,Q2)

q3= (Q1-Q2) * *

q3= (Q1-Q2) *0.1

q3= (Q1-Q2) *0.01

print ' you finally get the balance of %.2f '% (Q3)

If __name__== ' __main__ ':

YH ()

PY Practice X11

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.