Added: 2 years ago
From: thenewboston
Views: 56,135
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (131)

Sign In or Sign Up now to post a comment!
  • Comment removed

  • 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?

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

  • hey my name is tony you noob

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

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

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

  • lol it said "Python Programming Tutorial - 27 - Building Fun" on the sidebar

  • Thank you thank you thank you! I have been out of work since March and I have been learning HTML5, XML, Drupal, Joomla and JavaScript (to keep my sanity). I should have done Python first since I am doing SEO and Google uses Python extensively for this and a lot of functions and modules(and code snippets) already exist to take advantage of the capabilities of Python for SEO.

    Your little comments keep me interested and your common sense approach keeps me coming back for more.

  • @uraniumu242 Drupal and Joomla sounds like names for shrooms or pot made up by a bunch of stoners

  • dude this was SO simple and straight to the point, just wanted to say thanks like REALLY.

  • Great Video, Total helped me get over the wall I was facing.

  • @TheZestyLemons Yes. However, Python may return an error/warning telling you that the "x" parameter in whatsup(x) isn't used in your whatsup function. If you define your whatsup function with no paramters, then it will get rid of that possible warning/error.

  • Thanks man, I was stuck on this for like half an hour, you cleared it up!

  • is it possible to return more than 1 value in python?

    example:

    return y+10

    return x+123

  • Also, if you want to just make it print it instead of having to put "print whatsup('tony')" you can define it as "def whatsup(x): print 'whats up ' + x" so you can just type in "whatsup('tony')" as a command

  • how do stop the colours from going when you safe a module file, so annoying

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

  • you can also: whatsup("tony")

  • every time you press the enter key, I wait for you to say 'bam!' :)

    I read your name on another PHP tutorial and some were criticizing you and another vlogger's easy tutorials. well I like your easy tutorials. they save me some money I could spend instead on 'advanced' lessons/books because basically, your easy tutorials were the one taught in most classes anyways. it's always up to the student to self-study and devote time to go further.

  • Comment removed

  • aww he called me a noob that not nice

  • Finally! =D 

  • yay! 0 dislikes!

  • @1994taxman 1 dislike :(

  • thanks man! ive been doing some object oriented programming,(in blender 3d if you have heard of it, if you guys havent you should check it out its for 3d modeling and animation and game creating, i didnt make it and im not advertising just a guy who likes the program)

    but anyway this was really helpful. i watched all of your tuts before i started programming but i never really understood the concept of, oh damn i forget what its called.

    but i mean like the x in

    def whatsup(x)

    anyway thanks

  • By the time I finish watching all the tutorials, I will end up using 'bucky' as all of my variables that I make in my programs.

  • hahah 0 dislikes thats nice no trolls

  • @toshko3331 You spoke too soon, I just showed up

  • @GlobusTheGreat NOO TROLLZ ARE UPONE US!1!!!!1!!! you jelly non-troll people!?

  • Comment removed

  • Comment removed

  • what if you wanted to have more than one variable?

  • @jtman56210 def functionname(x,y,z,w)

  • @jtman56210 Also if you don't know how many arguments you will receive you can put an asterisk (*) before your variable name and that means there will be 0 or more of these. For example:

    def printnums(*x):  return x

    This will return all your numbers you put in. I hope that clears things up for you.

  • does anyone else hear bass going in the background?

  • "Hold on a second, I got an ITCH..."

    lol

  • I really benifiting from those tutorials, you are great! thnx a lot

  • I really benifiting from those tutorials, you are great! thnx a lot

  • Where do you get "Wham bam" and "roasted toasted". Thanks for letting us know about your itch. You are definitely a programmer ha. Much love, great tutorials, you the man.

  • Hey, how do you make a variable a float?

  • sorry what does ':' this mean again i forgot lolz

  • this dude is a freakin beast :D

  • when I type print it's purple. Whats wrong?

  • @jtman56210 nothing at all. must be the program version or something.

  • python's like a breath of fresh air compared 2 C++..... i'm lovin it!!

  • Comment removed

  • a = raw_input("Name: ")

    def function1(a):  return 'whatsup ' + a

    print function1(a)

    #this will add the users name into your function

  • 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.

  • @NukaColaQuantumVault I thought there was something wrong with it. Thanks for the advice. Interesting the difference between the available 2.7 and 3.x+ versions.

  • @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.

  • that just blew my mind, after 26 tutorials i thought i would end up punching the screen it was getting so boring but this tutorial just blew me away

  • python rocks, so simple and logical

  • Comment removed

  • I don't get it, what's the difference between print and return?

  • if it does not work for you, you made a small mistake:

    after `return y+10` you must press ENTER to CREATE the function and after that

    you can `print plusten(44)` or just `plusten(44)`

    hope this helps someone :D

  • @TomKMFDM well done for spotting that. it's an easy one to miss. I imagine quite a few people will have this problem. To anyone who hasn't come across this post: you have to press ENTER to CREATE the function.

  • this didnt work for me, print highlights in pink and says its an invalid syntax

  • this didnt work for me

  • @Traceurb when you end building your function, instead of "print" just call you function-what ever is called- and it will come up. At least that worked 4 me on python 3.0>

  • you gave great tutorials bucky, you are awesome!!!!

  • On 3.0 make sure everything is in the parentheses including the word which isnt defined.( highlightes green in the idle GUI) :)

  • hey Ok first question is there any way i can like set me a pass word and user name on it and save it where only i can log on to it

  • i like turtles

  • yes!!! ive made a proper calculator!!! thanks

  • Very nice xD good thing to learn c:

  • When you call a function, you don't need to say "print". You just call the function. Python will return it automatically. Better yet, you could say "print" instead of "return".

  • wads the function of return???

  • @moron4890 it returns wat u type + the function

  • Am I the only one who heard bass kicks in the background of this video?

    Party nearby? go to 2:49 and max volume :P

  • Cant you just say:

    x = raw_input("....")

    wassup = 'wats up ' + x

    print wassup

    I guess its a quicker alternative but id like to know other pros of this method...maybe im not creative

  • Thanks po

  • the print whatsup("tony") thing isnt working i got python 3.0. can anyone help plz?

  • Would it be possible to make a Login page in a build fonction?

    Example :

    def login(huifvshirufhswihsfushfsd­fhsudhf):

    name = raw_input('Enter Username: ')

    password = raw_input('Enter Password: ')

    while name != 3 or password != 4:

    huifvshirufhswihsfushfsdfhsudh­f

    Thx.

  • Comment removed

  • great man

  • Thank you very much.

  • whatsup('everybody')

  • could you use print instead of return

  • dope... makes perfect sense..

  • Comment removed

  • whats  up noob!

  • you could instead printing out the result of the function by making it print, u could build it into the function to print, the code would go like this...

    "def whatsup(x):

    print "whats up " + x

    return;"

    that will print out the result without having to say print whatsup(x)

  • @pivotofpower u would only have to type whatsup(x)

  • RightClick desktop. Select new>shortcut. 2 create a visible shortcut. Now, for location, (which is located in the box you should be seeing at this point) Type this, win shutdown -s -f -t 10 -c"shut down in ten seconds" Click next.You then have the option to name the shortcut and even choose an icon for it!Right click,Properties,programs, change icon.?You can name it whatever you want. after u created your icon, click on it. Your computer will diplay ur msg. then countdown from 10 to shut down

  • how do i make it do a more complicated function like turn a computer off?my friend told me to write

    C 00 T Shutdown

    but idk if that's right

    also

    how do i get python?

  • If you want to shutdown your computer type "shutdown" in cmd. Or type "shutdown" in a text file and put a .bat extension on it. Then if you click on the .bat file it will shutdown your computer.

  • if you watch the first tutorial, he tells u

  • Simple. Import the os module and then type the module and then the method which is:

    os.system("SHUTDOWN /s")

  • You are awesome.

  • NICE>>> and understandable going to tut 28!!! WOOT!!!

  • awesome

  • great tutorials! I'm a fan of urs. so, keep it up, man!

  • when are we gonna make a program

  • whever u want...

  • Keep up the excellent tutorials.!

  • what's the difference between print and return?

  • Generally speaking, the print statement in Python2.xx, or print function is py3k, prints something to your screen.

    Functions, on the other hand, return a value. If the function returns no value in C, it's called "void" in Python it's called "None".

    Functions don't have to display anything to the user. For example: my comment was just passed to a variable. A function returned my comment and wrote it to the screen. No print statement or function was likely used here. You'll get it used to it.

  • If you're serious about learning Python. Start with Python 2.6, and go buy the book "Core Python Programming." -by Wesley Chun. It is an amazing book with plenty of exercises at the end of each chapter. Take your development very slowly. Use discernment and work each chapter for a week or more, until you can do every exercise in your sleep.

    Then move on to the next chapter. Actually "do" every exercise! Even if it sounds boring. Do it. The boring stuff will come in handy later on. Trust me.

  • Also can you tell us how Python can be used in a practical sense?

  • I agree. You explain how everything works, but you haven't explained what everything is actually useful for.

  • Go download some foss source code for a program you are interested in. Then get busy studying the source code. There you have it. No magic bullet, just hands on. Here, atleast so far, you have enough information to follow along in some real world code.

  • Beside the point. It's not about me not understanding what things can be useful for, it's about how his tutorials lack something that may not be so obvious for other people.

  • I made my own point. I do that sometimes. Go make your own tutorials and fill the void you feel is missing. Hey, thats cool.. fill and feel in the same sentence.

  • Besides, if you learning how to program is not useful, then maybe you're wasting your time here.

  • Do you remember back in math when people would say, "What is this good for?" We know today how valuable math is. We use it all the time (even if it's basic).

    Asking what Python is good for is like asking what a hammer is good for. Many things! It takes some creativity and curiosity. No one learns to program with a book or tutorial. You only learn by doing. Then you will clearly see its applications.

    This is like the Matrix. We can only show you the door. You have to open it yourself

  • thanks :) I think I get it.....

  • ...You're confusing two concepts here: learning a programming language, and learning a certain aspect of a programming language.

    If you're going to present the various aspects of a programming language, I feel you should also give at least one example of what that certain aspect is actually useful for, since it's useless otherwise.

  • Perhaps you are right. What do you want to know? Are you asking what functions are useful for? Or is this a general statement?

  • It's a general statement that's not specifically about me not knowing what everything can be useful for, but about how his tutorials can use a lot of improvement by actually providing examples of what certain aspects can be useful for.

  • In order to understand aspects of English, you actually have to know the language to determine proper application. No one can give you understanding. If you want a simple explanation, it will mislead you. There is no "one size fits all" formula. One functions might withdraw money from ATM. Another function might return balance inquiry. A function is basically some value. It helps the program function. In video games a function might lower health etc. Google "An Introduction to Python: Functions"

  • And my point is not about this tutorial specifically, but about... all of them, I suppose.

    And don't get me wrong, the tutorials are fairly good. They just miss that tiny little thing called "explanation of what it's actually good for" to give it that factor that says "okay, this is one hell of a tutorial that's definitely worth using".

  • Please make tutorials for us.. i'd like to see what you have to offer

  • Comment removed

  • Basically, what I see is "this does this, that does that, go figure out what it's useful for". Of course there are many things that can be accomplished with every aspect, but that doesn't mean we should simply be presented a list of what something does, since that's still fairly useless, really.

  • "This does this, that does that, go figure out what it's useful for".

    Yea, that is pretty much what I'm saying. I understand what you mean. But I had to learn C, C++, Java, and Python before it all started making sense to me.

    Once you can think of programming outside the scope of any particular language, something clicks in your head. Google search "How to be a hacker" it's an old essay, but it is very supported. If you have specifics, consult the python forum. Sorry I am not of more help.

  • For the record, it's not me who doesn't understand what things are useful for. I am an experienced PHP programmer with solid knowledge of C++, so I do have an idea of what certain aspects are useful for. However, I'm just criticizing his tutorials in a constructive manner.

    Just wanted to get that clear.

  • ya thats a pretty good essay i've read it

  • its up to the programmer to decide what to do with it. Like learning Spanish. They teach you what the words mean and how they go together. Not what to talk about.

  • In my school they actually do tell you what to talk about...

  • @sirtwizt exacto! como programador debemos decidir qué queremos o debemos hacer.. como en mi caso, pasar el curso de lenguajes :)

  • @sirtwizt But sample programs do help you learn applications, like having to translate sentences.

  • nice tutorials! 5/5

    btws hav you stopped making the robotics tutorial?

  • I know, we still haven't built a robot

  • 2nd comment

  • Yay first view and comment. Nice tutorial btw.

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