User Profile

Collapse

Profile Sidebar

Collapse
Carlo Gambino
Carlo Gambino
Last Activity: Feb 27 '08, 02:26 AM
Joined: Feb 19 '08
Location: Ohio, USA
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Carlo Gambino
    replied to manipulating a string using ord()
    **Solved**

    In case anyone stumbles across curiosity on a smilar subject, here is the code that finally made this work for me:

    Code:
    >>> plaintext = 'aeiou'
    >>> list = [ord(letter) for letter in plaintext]
    >>> list
    [97, 101, 105, 111, 117]
    >>> list2 =[list[i-1]+i for i in range(len(list))]
    >>> list2
    [117, 98, 103, 108, 115]
    >>>
    ...
    See more | Go to post

    Leave a comment:


  • Carlo Gambino
    replied to manipulating a string using ord()
    well I'm almost there! I've found my way to the code that gets me (almost) where I want. There is only one small problem I don't seem to understand.

    Code:
    >>>t = raw_input("Enter string: ")
    >>>Enter string: aaaaa
    >>>list = []
    >>>for letter in t:
                list.append(ord(letter))
    
    >>> list
    [97, 97, 97, 97, 97]
    ...
    See more | Go to post

    Leave a comment:


  • Carlo Gambino
    replied to manipulating a string using ord()
    Right, thanks! I'm just frustrated because I've been pouring over forums and books for weeks trying to get off the ground with python and I feel like it's more trouble at every turn.

    Thanks for the post! Your code helps more than I can express! You've let me see the light, thanks again!
    See more | Go to post

    Leave a comment:


  • Carlo Gambino
    started a topic manipulating a string using ord()

    manipulating a string using ord()

    I'm trying to manipulate strings of user input data, using ord() to assign the decimal value to each character in the string. I can return the values, but need to understand the best way to store the decimal values, manipulate them, and return the new values to a new string.

    Any input or suggestions?
    See more | Go to post

  • I'm not sure I'm able to understand how to apply the code above to the purpose at hand. Is there any way to convert the character to it's decimal value? I've seen this done with C/C++, C#, even VB, I have a hard time believing python can't!
    See more | Go to post

    Leave a comment:


  • Carlo Gambino
    started a topic Char to Decimal conversion

    Char to Decimal conversion

    I came across this article on MSDN and was hoping someone here can help me understand a similar way to accomplish this with Python?
    See more | Go to post

  • dd = dict(zip(letter s, range(ord('a'), ord('z')+1)+ran ge(ord('A'), ord('Z')+1)))

    Well this is certainly pointing me in the right direction (I think). Thanks for the post!

    It does bring me to a question, however. In your example, your output for A is 66. When I replicate the code, I get an output of 97. If I pay more attention, I find your code:

    Code:
    #
    >>> letters
    #
    'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW
    ...
    See more | Go to post

    Leave a comment:


  • Please help me understand the easiest way to do this..

    I want to assign each ASCII character the associated decimal value. Can anyone point me in the right direction to do this without manually defining each character?
    See more | Go to post

  • Carlo Gambino
    replied to Need to send 150 MB and above files
    While I am a big fan of dropload ( www.dropload.co m ) and rapid share ( ww/w.rapidshare.co m ), they are both limited to 100MB.

    A quick google search and I found not only sites like file lime ( www.filelime.co m ) and www.uploading.c om, but even www.box.net which claims up to 1GB free file sharing and storage, though couldn't determine if that was gross storage space or if you could actually store a single 1GB file there. If you use...
    See more | Go to post

    Leave a comment:


  • Carlo Gambino
    started a topic decrypting a string

    decrypting a string

    I am looking into learning the basics of cryptography and would like to use python to help me overcome this small challenge. I would like to create a program that takes a user input string and decrypts it.

    The encrpytion is super simple. The string
    Code:
    aaaaa
    would return
    Code:
    abcde
    I was thinking I could assign a value to each character and increment the value accordingly, but I was looking for...
    See more | Go to post

  • Carlo Gambino
    replied to What is your OS and Python Version
    OS: Ubuntu 6.06 Dapper Drake
    Python 2.4.3
    IDLE
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...