User Profile

Collapse

Profile Sidebar

Collapse
pyn00b
pyn00b
Last Activity: Feb 29 '08, 12:30 AM
Joined: Feb 19 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • pyn00b
    replied to return keyword
    Thank you! Yes, this is clearer to me now. So no return statement means that no value is returned (after reading elsewhere a little I found this means it returns a value of None). Anything more than 1 variable being returned results in a list being returned. As well, I didn't know that no return and a return without a variable are the exact same thing....
    See more | Go to post

    Leave a comment:


  • pyn00b
    started a topic return keyword

    return keyword

    In a Python function definition, sometimes you don't see the return keyword at all. Sometimes, you see it all by itself. And sometimes, you see it associated with a bunch of variables - like "return x, y, z".

    Can someone clearly explain the differences between these 3 scenarios? What exactly is happening? What is the Python keyword "return" for?
    See more | Go to post

  • pyn00b
    replied to Concatenation
    dshimer, jlm699, and bvdet - thanks to you all for responding. That was very helpful and educational!
    See more | Go to post

    Leave a comment:


  • pyn00b
    replied to Concatenation
    Thanks! Sorry about that. New here. :)...
    See more | Go to post

    Leave a comment:


  • pyn00b
    replied to Concatenation
    Python. So here is some code...

    num = raw_input("Pick a number: ")
    num = int(num)
    print "Your number times 5 is", num * 5, "."

    This produces a space between num and the period. If I try to use "+" I get an error trying to concatenate a str and int. It's possible to print str(num) and then concatenate that result with the period to eliminate the space. But I was wondering...
    See more | Go to post

    Leave a comment:


  • pyn00b
    started a topic Concatenation

    Concatenation

    After getting raw_input from the user, I want to print a sentence that ends in an integer and then the "." character. Of course, if I print using a comma (,) I don't get an error but there is an ugly space between the integer and the period. But if I try "+" then I obviously get a str/int concatenation error.

    One way to solve this is to convert the int into a str and then "+" works. But is there an easier...
    See more | Go to post
No activity results to display
Show More
Working...