User Profile

Collapse

Profile Sidebar

Collapse
shycat518
shycat518
Last Activity: Apr 28 '07, 03:03 AM
Joined: Mar 1 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • shycat518
    replied to Returning two variables?
    Since I'm still new at Python and am having tons of problems with more than one functions, I've been playing around with them.

    Here's program I've been working with. It, of course, doesn't work. According to my boyfriend I still don't understand passing and returning variables. :P At least I'm trying. . .

    Code:
    def main():
        askfor()
        hours()
        pay()
    
    def askfor():
    ...
    See more | Go to post

    Leave a comment:


  • shycat518
    replied to Returning two variables?
    That's good to know I was at least doing it half right. :) I didn't try the ().
    See more | Go to post

    Leave a comment:


  • shycat518
    replied to Returning two variables?
    Awesome, thanks. :)
    See more | Go to post

    Leave a comment:


  • shycat518
    started a topic Returning two variables?

    Returning two variables?

    Okay, is it possible to return two variables in one function?
    See more | Go to post

  • shycat518
    replied to numeric value of a single name.
    Thanks to everyone's advice, here's the final coding. :)

    Code:
    def main():
        alpha2num = {'a':1 , 'b':2 , 'c':3 , 'd':4 , 'e':5 , 'f':6 , 'g':7 , 'h':8 , 'i':9 , 'j':10 , 'k':11, 'l':12, 'm':13, 'n':14, 'o':15, 'p':16, 'q':17 , 'r':18 , 's':19 , 't':20 , 'u':21 , 'v':22, 'w':23 , 'x':24 , 'y':25 , 'z':26 }
        print "Numeric value for a single name"
        name = raw_input("Please enter your first
    ...
    See more | Go to post

    Leave a comment:


  • shycat518
    replied to numeric value of a single name.
    Yay, I'm so happy, it finally worked thanks to all you guys. :) I was starting to think Python hated me.
    See more | Go to post

    Leave a comment:


  • shycat518
    replied to numeric value of a single name.
    Code:
    def main():
        alpha2num = ('a'[B]:[/B]1 , 'b':2 , 'c':3 , 'd':4 , 'e':5 , 'f':6 , 'g':7 , 'h':8 , 'i':9 , 'j':10 , 'k':11, 'l':12, 'm':13, 'n':14, 'o':15, 'p':16, 'q':17 , 'r':18 , 's':19 , 't':20 , 'u':21 , 'v':22, 'w':23 , 'x':24 , 'y':25 , 'z':26)
        print "Numeric value for a single name"
        name = raw_input("Please enter your first name: ").lower()
        total = 0
        for ch in name:
    ...
    See more | Go to post
    Last edited by bartonc; Mar 2 '07, 12:45 AM. Reason: added [code][/code] tags

    Leave a comment:


  • shycat518
    replied to numeric value of a single name.
    I've tried the 'a' : 1 before, but for some odd reason python keeps saying it's wrong....
    See more | Go to post

    Leave a comment:


  • shycat518
    replied to numeric value of a single name.
    Hmm, I messed up somewhere else and it wouldn't even let me run it. So I'm going to stop for tonight. :(

    What I'm trying to do with this program is have a name entered, add up the value, and come up with a sum.

    example: Zelle
    26 + 5 + 12 + 12 + 5 = 60

    It sounds like an somewhat easy program (since this would be my fourth one), but after staring at it for a few hours, it's not that easy anymor...
    See more | Go to post

    Leave a comment:


  • shycat518
    replied to numeric value of a single name.
    That could help. . . Right now, all I have is (the beginning of it).

    def main():

    print "Numeric value for a single name"
    name = raw_input("Plea se enter your first name: ")


    I've been trying to write this program for a while, but I've been stuck. I'm very new at this.
    See more | Go to post

    Leave a comment:


  • shycat518
    started a topic numeric value of a single name.

    numeric value of a single name.

    I'm having trouble writing a program that calculates the numeric value of a single name. . .

    ie: a = 1, b = 2, and so on.

    I have to use the ASCII character set and ord function. And I have to force the upper/lower case.

    Anyone? I'm new to Python and I'm trying to learn it. :(
    See more | Go to post
No activity results to display
Show More
Working...