Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Python Programming Tutorial - 27 - Building Functions

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
55,759
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 25, 2009

Part 28 - http://www.youtube.com/watch?v=y_2uy1TOH1M

How to create your own function in python.

  • likes, 1 dislikes

Link to this comment:

Share to:

Top Comments

  • @1Moonwalker when u save the file put ".py" after the file name and colors will come back :)

  • If you try to use what Bucky did here in Python 3x+, you will get this.

    >>> def whatsup(x): return 'Whats up ' + x

    >>> print whatsup ('Alex?') 

    SyntaxError: invalid syntax

    To fix this, you need the syntax form as shown below.

    >>> print (whatsup('Alex?'))

    Then Python will echo.

see all

All Comments (131)

Sign In or Sign Up now to post a comment!
  • can't we use a variable as an input?

    

  • >>> def hello(x): print "Hey there " + x

    >>> print hello("Dom")

    Hey there Dom

    None

    >>> print hello ('Dom')

    Hey there Dom

    None

    >>>

    why is it saying none?

  • @NukaColaQuantumVault actually, in python 3x you don't really need to use the print, you just need to call the function, like that: whatsup("Alex") like other functions that we call...then python will return the result.

  • can i use python with udk and 3ds max?

  • hey my name is tony you noob

  • @TeamINSTINKED A free " C Dos, C Dos Run" T-Shirt, postage not covered though :/

  • why didnt you use "print" statement ? in which tutorial you used the "return" statement?

  • @1994taxman 1 dislike :(

  • Hahaaa I was the 50,000th view wot do I get ??????

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more