‘‘‘
1. Write the program, get a person's information from the keyboard, and then display the ================================== in the following format???
Name:? Dongge????? ????
Qq:xxxxxxx?????
Phone number: 131xxxxxx???
? Company address: Beijing xxxx?
‘‘‘
Name=input ("Please enter Name:")
Qq=input ("Input QQ:")
Cell=input ("Please enter phone number:")
Address=input ("Please enter Address:")
Print ("="
25)
Print ("Name:%s"%name)
Print ("qq:%s"%QQ)
Print ("Phone number:%s"%cell)
Print ("Address:%s"%address)
Print ("="25)
‘‘‘
2. Enter the length and width of a square to calculate and print its area
‘‘‘
Length=float (Input ("Please enter the length of the rectangle:"))
Wide=float (Input ("Please enter the width of the rectangle:"))
Area=length*wide
Print ("Rectangular area =%f:"%area)
‘‘‘
2. Enter the length and width of a square to calculate and print its area
‘‘‘
Import Math
Radius=float (Input ("radius of circle ="))
Area=math.pi*radius**2
Print ("Circle area =%f"%area)
‘‘‘
Data:
Principal
Annual interest rate
Instructions:
Enter Principal
r1=4.1% r2=3.59% r3=2.28%
Output Principal and
‘‘‘
Num=int (Input ("Please enter the amount to deposit:"))
r1=4.1/100
r2=3.59/100
r3=2.28/100
S1=num+numR1
S2=num+numR2
S3=num+num*r3
Print ("%.2f\n%.2f\n%.2f\n"% (S1,S2,S3))
‘‘‘
Data:
Area S
Unit Price U
Mortgage ratio m
Commercial loan Interest Rate C
Repayment Life T
Monthly Supply ms
Down Payment p
Instructions:
Enter S, u, M, C, t
Down payment = Area Unit Price mortgage ratio
Monthly supply = Area Unit Price (1-mortgage ratio)(1+)/Repayment life/1
Output P, MS
‘‘‘
S=float (Input ("area:"))
U=float (Input ("unit Price:"))
M=float (Input ("mortgage ratio:"))
C=float (Input ("commercial loan interest Rate:"))
T=float (Input ("Payback period:"))
P=sum
Ms=su(1-m)(1+c)/T/12
Print ("Down Payment:%s\n Month:%s"% (P,MS))
Python Case 1