Advertisement
gauravssnl

pokemon.py

Mar 16th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. # pokemon.py by gauravssnl
  2.  
  3. pokemonL = [ ]
  4.  
  5. while True :
  6.     pname = raw_input( 'Pokemon Name:' )
  7.     if pname != " "  and pname not in pokemonL :
  8.         pokemonL.append( pname )
  9.     elif pname == " " :
  10.         break
  11. # sort name
  12. pokemonL.sort( )
  13.  
  14. # relate each pokemon to remaining pokemon
  15.  
  16. for i in range( len( pokemonL ) ) :
  17.     for j in pokemonL[ i+1 : ] :
  18.         print("%s defeats %s"%( pokemonL[i] , j ) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement