#------------------------------------------------------------------------------- # Name: game # Purpose: # # Author: gaabell # # Created: 09/01/2013 # Copyright: (c) gaabell 2013 # Licence: <your licence> #------------------------------------------------------------------------------- #!/usr/bin/env python import random def creeps(numberMonster): amount = 0 while amount < numberMonster: monsterType = random.randint(1,5) if monsterType == 1: print("A goblin appears!") elif monsterType == 2: print("A kobald appears!") elif monsterType == 3: print("A rat appears!") elif monsterType == 4: print("An orc appears!") elif monsterType == 5: print("You see no monsters approaching...") amount = amount+1 creeps(9)
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