def ship(ship_type): global att global arm global sub if ship_type == strike_fighter: att = 1 arm = 10 sub = 0 elif ship_type == frigate: att = 100 arm = 2000 sub = 0 elif ship_type == destroyer: att = 150 arm = 3000 sub = 0 elif ship_type == scout_cruiser: att = 200 arm = 4000 sub = 0 elif ship_type == battle_cruiser: att = 250 arm = 5000 sub = 0 elif ship_type == carrier: att = 100 arm = 10000 sub = 0 elif ship_type == battleship: att = 500 arm = 10000 sub = 0 elif shipip_type == command_ship: att = 750 arm = 30000 sub = 0
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