[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –
Python Programming Tutorial – 27 – Building Functions
Comments
50 responses to “Python Programming Tutorial – 27 – Building Functions”
-
How can I get this to work on 2.7.13?
-
Is it possible while calling the function to put an input so the user can input what he wants for (in this case) x?
-
A calculator
s=—-Your—-Number-
–
y=—Your—-Number—
answer=(s + y)
print (answer) -
great explanation ,,,
-
ROASTED TOASTED
-
dude it's not workin for me I can create a subroutine but it wont let me use it
-
Thanks a lot man, I'm using Python 3.4 but I got it anyways. Very helpful, good explanation too.
-
this really helped me out thanks a lot man
-
instead of return at the end of the function, why don't you right print instead.
-
I think def function would be useful for building quiz, exams site. I defined a function to tell me correct! when I wrote my wife name for the question that says 'who is standing beside me?'. And when I write a different name, to tell me, 'Oops, try again.'
-
why wont mine work
def whatsup(x):
return "Whats up" + xprint(whatsup('tony'))
-
mine's not working , im working with python 3.3:
def whatsup(x):
return 'whatsup ' + x
print whatsup('tony')
———————————————————————————————
print whatsup('tony')
^
SyntaxError: invalid syntaxPlease help!
-
THANK YOU!!!!!!
-
Dude you are really helping me out with all these videos ..thanks a lot man
-
I don't know about python 2, but in python 3 you can actually just call your function by entering it's name and press enter… like: function('your x-value') and then press enter
-
Python 3+
print ( whatsup ( 'tony' ) ) -
Sounds like his neighbours are having a party.
-
Thanks!
-
Thank you, this helped a lot 🙂
-
first you have to
>>>def f(y): # press enter
return y +10 #press enter 2 times
>>> print f(44) # this will work -
your missing an "x" def whatsup(x)
-
x=""
def whatsup (x):
x=input ("enter your name: ")
return "whats up "+ x
print (whatsup(x)) -
>>> def f(y):
return y+10
print(f(44))
Can someone tell me where i'm going wrong here? -
3:25 – 3:26
-
variable = raw_input()
function(variable) -
How do I let the user input in my functions?
-
How do I let the user input in my functions?
-
Sorry, I want to edit the 1st line in my comment below, the code is
def whatsup(x):
it still doenst work. -
Why does it work?
My code:
def whatsup():
return ('whats up' + x)
print (whatsup('tony')) -
METHODS!
-
thanks
-
Add a colon at the end
-
at 1:20 how did you enter down without making a new line of input(my best way of saying without having the '>>>' at the start of the line) in python shell???
-
Try this 😛
def CountTo(count):
x = 1
while x <= count:
print x
x += 1
And then you can type in CountTo(So high you want to count!) -
I actually found out why. I didn't watch the tutorial this time as well as before, and I hit enter only once when I should have hit it twice to end the command.
-
check which version u're working with, if version 3+ ,u may need to use like this:print( here's what he typed after)
-
Why do I keep getting an invalid syntax on "print"?
-
It's about to get a lot harder.
-
I don't think there's a better way to learn python. I just wish he would make another one for python3x. People say there's not a lot of difference, but there's still a good amount especially when working with integers and strings.
-
Actually, for 3.3, use print(whatsup('tony')) cuz print is now a method in python!
-
dis python shit is too easy mayne
-
very very helpful thanks so much very funny and informative
-
hey for 3.3 instead of typing print whatsup('tony') just type whatsup('tony')
-
Maybe you're not using the same version .. he is using 2.6
-
Technically, yes, you are right. But some people, myself included, who are not from the U.S. say brackets (meaning round brackets) as the term for parentheses. So they can be, in fact, the same thing depending on where you come from.
-
how about having more than one parameter in the function!!
-
userdefined functions superb video
-
file > New Window >
def whatsup(x):return 'whatsup'+x
print (whatsup('Tony'))save as
run
-
That is because you need a comma so its return ("what's up", +x)
-
just use brackets "return ("what's up" + x) 🙂
Leave a Reply