Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 74 Online
OpenStudy (anonymous):

i have question about the first hw (sorry, new beginner here): i have these raw_input: balance = float(raw_input("Enter the outstanding balance on your credit card: ")) annualInterestRate = float(raw_input("Enter the annual credit card interest rate as a decimal: ")) minMonthlyPaymentRate = float(raw_input("Enter the minimum monthly payment rate as a decimal: ")) but when i test it, python only shows the first "Enter the outstanding balance on your credit card:" why python didn't ask me other two???

OpenStudy (curry):

well did you enter a number and press enter?

OpenStudy (anonymous):

yes, but python didn't ask my to keep enter the second and third raw_input

OpenStudy (curry):

hmm, you might be entering the wrong input. rawinput takes a string and float() converts that to a number. So does the program crash after that first raw input? or does it end successfully? is there an error message?

OpenStudy (anonymous):

the program do nothing and stand still after i type in the input. let's say i want put 5000 in first BALANCE, should I type 5000 only, or '5000'?

OpenStudy (anonymous):

here is my file. please take a look. After I type in 5000 it didn't move on to ask me the second and third raw_input

OpenStudy (anonymous):

are you just pasting that code into the python REPL?

OpenStudy (anonymous):

you should save it to a file and execute using: python creditcard.py also you need to be careful with the consistency of your names (totalAmtpaid vs totalAmtPaid)

OpenStudy (anonymous):

how do i execute it exactly?? through IDLE?

OpenStudy (anonymous):

In the python shell. Go File, New window. then copy your code over, save it and then run the module

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!