![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Newbie
Join Date: Nov 2007
Posts: 11
Rep Power: 0
![]() |
Re: Need help with python
Well if I can't get this one I'll never get the 2 harder ones after this.
Time to post this on elance I guess. I tried my best. |
|
|
|
|
|
#12 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,798
Rep Power: 5
![]() |
Re: Need help with python
Wow. I actually can't believe it. I've given you a wealth of code to go by.
In fact, if you copy and pasted right now all of my revisions to your 4 lines, you would only need to run it to see you have a workable program. It's pretty obvious you're not even trying at this point. Anyways, have fun frivolously disposing of your money and the time I set aside. Adios. |
|
|
|
|
|
#13 |
|
Newbie
Join Date: Nov 2007
Posts: 11
Rep Power: 0
![]() |
Re: Need help with python
Actually I did try cutting and pasting what you wrote and I still couldn't get it.
Maybe when I actually have the program done in front of me then I can go back line by line and see and work out where the problem was. I'm like an English person trying to speak Mandarin in China. I don't know the language. |
|
|
|
|
|
#14 |
|
Newbie
Join Date: Nov 2007
Posts: 11
Rep Power: 0
![]() |
Re: Need help with python
This is the trouble I'm having. You wrote this:
my_string = raw_input("Enter A String: ") Great, but am I supposed to enter the names of Billy and Bob where the "Enter A String" is, or do I enter the line exactly as shown? I know the answer is in front of me; I just don't know when/where to edit the lines to enter the information I need to. That is what is messing me up. Damn it, now I'm determined to learn this stuff. Not just to pass this course, but honestly, it's pissing me off because there is nothing I ever quit on. If I get stuck with something, I'll usually end up mastering it, but for some reason this programming has been a definite challenge. |
|
|
|
|
|
#15 |
|
Newbie
Join Date: Nov 2007
Posts: 11
Rep Power: 0
![]() |
Re: Need help with python
Apparently this doesn't work either...
my_string = raw_input("Enter A String:Billy")
my_integer = input("Enter A Number:23")
my_added_string = my_string + Billy
my_string2 = raw_input("Please Enter Another String: ")
my_added_string = my_string + my_string2
print my_added_string
my_added_integer = my_integer + 2
print my_added_string
print my_added_integerLast edited by DaWei; Nov 19th, 2007 at 1:29 AM. Reason: Added code tags. |
|
|
|
|
|
#16 |
|
Newbie
Join Date: Nov 2007
Posts: 11
Rep Power: 0
![]() |
Re: Need help with python
Well, thanks anyway.
|
|
|
|
|
|
#17 | |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,798
Rep Power: 5
![]() |
Re: Need help with python
Quote:
And I believe we've found your problem! You greatly misunderstood what "raw_input" does. my_string = raw_input("Enter A String:Billy")Have you tried running this on its own? What "raw_input" does, is it shows some text to the user. And then prompts him/her to enter something back! The text that is shown to the user is whatever you've enclosed in the brackets. In your case, "Enter A String:Billy". Therefore... when you run that program, the user will see: Enter A String:Billy The user will type something in, and "my_string" will equal whatever the person running the program typed in. Try running this: x = raw_input("How are you today? ")
y = raw_input("What's your favourite kind of salad? ")
print x
print yIt will prompt you for something twice. Type something in each time and hit enter. I hope you get a definite EUREKA! moment! Last edited by Sane; Nov 19th, 2007 at 2:23 AM. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perfect Python | Dietrich | Python | 30 | Jan 5th, 2007 12:38 PM |
| [tutorial] Python for programming beginners | coldDeath | Python | 30 | Dec 14th, 2005 11:35 AM |
| Convert Python script to C++ code | clanotheduck | Python | 17 | Sep 25th, 2005 8:55 AM |
| Advanced Python Tricks | Arevos | Python | 19 | Sep 24th, 2005 7:39 AM |
| Python - A Programmers Introduction | coldDeath | Python | 17 | Aug 19th, 2005 12:41 PM |