ok im new so dont judge but i need help with the raw_input if thats what you call it
this is the program i just need help with the user input the rest i can do ?
whats your name? <user enters name>
hello <name>
user input help
Page 1 of 13 Replies - 466 Views - Last Post: 11 August 2012 - 09:05 PM
Replies To: user input help
#2
Re: user input help
Posted 10 August 2012 - 07:54 AM
I guess you are using Python v2.x since you are using raw_input(). So have you checked the python documentation yet? That is usually a good place to start for Built-in functions such as raw_input().
Here is a link to the documentation:
http://docs.python.o....html#raw_input
It gives you an explanation of what it does and all the arguments that are passed to it. It also shows a few examples that should help.
Here is a link to the documentation:
http://docs.python.o....html#raw_input
It gives you an explanation of what it does and all the arguments that are passed to it. It also shows a few examples that should help.
#3
Re: user input help
Posted 11 August 2012 - 06:44 PM
#!/usr/bin/python3
name = input('Please enter your name: ')
print ('Hello', name)
This is probably the simplest way to answer your question. *Take note I am using Python 3*
#!/usr/bin/python3
This is called a shebang line *Explanation*
name = input('Please enter your name: ')
This is a simple input. In python 3 there is no raw_input. *More info*
print ('Hello', name)
This simply prints 'Hello' and the name of the user which we assigned to variable 'name'. *More Info,*
I hope that I assisted in some way
#!/usr/bin/python3
name = input('Please enter your name: ')
print ('Hello', name)
This is probably the simplest way to answer your question. *Take note I am using Python 3*
#!/usr/bin/python3
This is called a shebang line *Explanation*
name = input('Please enter your name: ')
This is a simple input. In python 3 there is no raw_input. *More info*
print ('Hello', name)
This simply prints 'Hello' and the name of the user which we assigned to variable 'name'. *More Info,*
I hope that I assisted in some way
#4
Re: user input help
Posted 11 August 2012 - 09:05 PM
Perhaps it didn't occur to you why we would refer a user to documentation rather than spoon feeding them... There's an analogy regarding fishing, you should research it. See what I did there?
This post has been edited by atraub: 11 August 2012 - 09:11 PM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote






|