print "Welcome to my Game" #!/usr/bin/python name = " While name != 'quit' : name = raw_input('what is your name? ') if name == 'Will' : print "Will, your the best python developer in the world!" else : print 'hello' , name if name == 'jaffa cakes' print "Same I love get enough of them.... oh im a computer never mind" else : Print 'Urm... food...' Lua :== syntax 760: alpha/ __pycache__/ __init__.cpython-32.pyc one.cpython-32.pyc two.cpython-32.pyc __init__.py one.py two.py beta/ __pycache__/ __init__.cpython-32.pyc three.cpython-32.pyc four.cpython-32.pyc __init__.py three.py four.py alpha/ __init__.py one.py two.py beta/ __init__.py three.py four.py print "hello world" 246.print('Welcome to Reversi!') 247. 248.while True: 249. # Reset the board and game. 250. mainBoard = getNewBoard() 251. resetBoard(mainBoard) 252. if whoGoesFirst() == 'player': 253. turn = 'X' 254. else: 255. turn = 'O' 256. print('The ' + turn + ' will go first.') 257. 258. while True: 259. drawBoard(mainBoard) 260. scores = getScoreOfBoard(mainBoard) 261. print('X has %s points. O has %s points' % (scores['X'], scores['O'])) 262. input('Press Enter to continue.') 263. 264. if turn == 'X': 265. # X's turn. 266. otherTile = 'O' 267. x, y = getComputerMove(mainBoard, 'X') 268. makeMove(mainBoard, 'X', x, y) 269. else: 270. # O's turn. 271. otherTile = 'X' 272. x, y = getComputerMove(mainBoard, 'O') 273. makeMove(mainBoard, 'O', x, y) 274. 275. if getValidMoves(mainBoard, otherTile) == []: 276. break 277. else: 278. turn = otherTile 279. 280. # Display the final score. 281. drawBoard(mainBoard) 282. scores = getScoreOfBoard(mainBoard) 283. print('X scored %s points. O scored %s points.' % (scores['X'], scores['O'])) 284. 285. if not playAgain(): 286. sys.exit()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question