User Profile

Collapse

Profile Sidebar

Collapse
oursmokeingjoe
oursmokeingjoe
Last Activity: Mar 29 '08, 04:19 AM
Joined: Mar 29 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • oursmokeingjoe
    replied to int input
    # heres the problem how can i manipulate just row = to get the aproiate response
    position = 'cd'
    col = position[0]
    row = int(position[1])
    if col in ['a','A','b','B' ,'c','C','d','D ','e','E','f',' F','g','G','h', 'H'] and row in [1,2,3,4,5,6,7,8]:
    print 'The piece is moved to %s%s.' % (col,row)
    elif col not in ['a','A','b','B' ,'c','C','d','D ','e','E','f',' F','g','G','h', 'H'] and row in [1,2,3,4,5,6,7,8]:...
    See more | Go to post

    Leave a comment:


  • oursmokeingjoe
    started a topic int input

    int input

    sorry but this is probably a stupid question but;
    if you have an input like
    pos = 'c3'
    #and you want to take out the second character as an int what do you need to add to stop it from producing an error if the second character is a letter
    eg. pos = 'cd'
    # i've been using
    int(pos[1]) # but it gives an error when the [1] is a letter not a number.
    See more | Go to post

  • oursmokeingjoe
    started a topic how to remove space

    how to remove space

    hey i've only just started using python so i'm not to good at it but how do you remove the spaces in a print out like this

    col = b
    row = 2
    print 'the position is',col,row,'.'
    the position is b 2 .
    #those spaces between the b the 2 and the .
    See more | Go to post
No activity results to display
Show More
Working...