Home > other >  Ask a question of Python ahhh
Ask a question of Python ahhh

Time:09-25

Question of exchange rates, as is very simple, but really can't make out ahhh, help

CodePudding user response:

Problem is not difficult, the next or oneself how to think of it, to try and write out the
 
Hui_lv=input (" please enter between the dollar and the RMB exchange rate: ")
Print (" $$0 yuan, 1 yuan to turn ")
Bi_zhong=input (" please select conversion types: ")
Amount=input (" please input to the number of currency conversion: ")

If bi_zhong=="0" :
Result=float float (amount) * (hui_lv)
Elif bi_zhong=="1" :
Result=float (amount)/float (hui_lv)
The else:
Result=0

If the result==0:
Print (" error input ")
The else:
If bi_zhong=="0" :
Print (" you will use $exchange for RMB {0} {1} knife ". The format (amount, the result))
Elif bi_zhong=="1" :
Print (" you will use ${0} {1} knife in exchange for RMB yuan ". The format (amount, the result))

CodePudding user response:

 
# start
Huilv temporary $1===6.6 # 6.6 yuan
Print (" $1 RMB for $2. The change of RMB ")
A=input (" please tell your demand:)
If the int (a)==1:
B=int (input (" please enter the amount you want to change the: "))
C="{} {} {}". The format (" you can change, "b/huilv," $")
Print (c)
Elif int (a)==0:
B=int (input (" please enter the dollar amount you want to change, "))
C="{} {} {}". The format (" you can change, "b/huilv," yuan ")
Print (c)
The else:
Print (" best according to the word you say!" )
# end

CodePudding user response:

 change=input (" please enter the dollar and the RMB exchange rate (1:6. 6) : ') 
If change the=="" :
Change=6.6
The else:
Change=float (change)
Choose=input (' conversion choose $$0 to turn the yuan RMB 1 turn: ')
While choose the not in (" 1 ", "0") :
Print (' input error! Please choose again ')
Choose=input (' conversion choose $$0 to turn the yuan RMB 1 turn: ')
Num=float (input (' please enter the number of conversion: '))
If choose the=="1" :
Print (' {0:. 2 f} RMB exchange RMB '{1:2 f}. The format (num, num/change))
Elif choose=="0" :
Print (' {0:. 2 f} $exchange} {1, 2 f RMB '. The format (num, num * change))
The else:
Print (' I go to, also can to here, want to what? ')
  • Related