Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 19th, 2007, 12:36 AM   #11
charleneherron
Newbie
 
Join Date: Nov 2007
Posts: 11
Rep Power: 0 charleneherron is on a distinguished road
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.
charleneherron is offline   Reply With Quote
Old Nov 19th, 2007, 12:43 AM   #12
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
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.
Sane is offline   Reply With Quote
Old Nov 19th, 2007, 12:48 AM   #13
charleneherron
Newbie
 
Join Date: Nov 2007
Posts: 11
Rep Power: 0 charleneherron is on a distinguished road
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.
charleneherron is offline   Reply With Quote
Old Nov 19th, 2007, 12:56 AM   #14
charleneherron
Newbie
 
Join Date: Nov 2007
Posts: 11
Rep Power: 0 charleneherron is on a distinguished road
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.
charleneherron is offline   Reply With Quote
Old Nov 19th, 2007, 1:07 AM   #15
charleneherron
Newbie
 
Join Date: Nov 2007
Posts: 11
Rep Power: 0 charleneherron is on a distinguished road
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_integer

Last edited by DaWei; Nov 19th, 2007 at 1:29 AM. Reason: Added code tags.
charleneherron is offline   Reply With Quote
Old Nov 19th, 2007, 1:22 AM   #16
charleneherron
Newbie
 
Join Date: Nov 2007
Posts: 11
Rep Power: 0 charleneherron is on a distinguished road
Re: Need help with python

Well, thanks anyway.
charleneherron is offline   Reply With Quote
Old Nov 19th, 2007, 2:11 AM   #17
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
Re: Need help with python

Quote:
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.
Thank heavens. That's the damn right attitude!



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 y

It 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.
Sane is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:24 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC