Ask Experts Questions for FREE Help !
Ask
    andyhaus1057's Avatar
    andyhaus1057 Posts: 98, Reputation: 1
    Junior Member
     
    #1

    Jul 9, 2009, 07:58 PM
    learning programs
    Hi, I'm stumped with this.. Can you please help?


    1) What could I expect as output to the program?

    studentName = raw_input ('Enter student name. ')


    2) What type of value can I expect the user to enter?

    creditsDegree = input ('Enter credits required for degree.')


    3) Which functions should be used to take in input from the user?
    1) studentName
    2) creditsDegree
    3) creditsLeft

    I do know that they are either
    a) raw_input
    or
    b) input ()
    Perito's Avatar
    Perito Posts: 3,139, Reputation: 150
    Ultra Member
     
    #2

    Jul 9, 2009, 08:20 PM

    I'm uncertain why you're stumped. It seems very straight-forward. This appears to be the Python programming language. You really need to identify that when you ask questions because there are many programming languages, and they use the same keywords for different things.

    raw_input returns a string to the program. It prints the prompt that is shown in parentheses, probably in a message box and returns whatever the user entered.

    input returns a "Python Expression". You'll have to figure what that is; no one else has been able to do it. ;)

    If you wish to return a string, select "raw_input". A student name would obviously be a string. A number would probably have to use "input", though it's probably possible to get a string and convert it to a number.

    I think you can figure out the answers.

    Oh, I found this link that might be useful:

    Python - input v raw input

    By the way, put future questions under "Programming".
    chuckhole's Avatar
    chuckhole Posts: 850, Reputation: 45
    Senior Member
     
    #3

    Jul 13, 2009, 07:18 AM
    Quote Originally Posted by Perito View Post
    ........You really need to identify that when you ask questions because there are many programming languages, and they use the same keywords for different things............
    By the way, put future questions under "Programming".
    Totally agree. There are so many scripting languages and an incomplete question can easily result in a wrong or incomplete answer.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Must Have/Useful Programs [ 66 Answers ]

I thought it would be a good idea to get a list of useful programs that we could keep here. If a mod comes across this - could you sticky it please. It would be quite helpful. I'm bound to have missed some programs, so if there is some that you think should be on this list - post here or PM me...

How to change rar programs into zip programs [ 5 Answers ]

I would like to ask how can I change the rar files into a zip files in my PC and then move then to my phone because my phone is not accepting any rar file and I would like to download some programs as the unidictionary and a recorder without peeb so please help meeeeeeeee.

Distance learning or traditional learning [ 4 Answers ]

which is more better distance learning or traditional learning?:)

Pc fix programs [ 2 Answers ]

Hello all does anyone know of any program I can download that will scan my PC for errors and not ask me for payment at the end of it? Thanks for reading x


View more questions Search