import random scopes = ['ironsight','sniper','variable zoom','red dot','recon'] Perks = ['increased rate of fire','incresed damage','homing rounds','elemental reload','instant reload','larger magazine','larger ammo capacity','increased range','increased damage','self generating ammo','aim assist increased','rounds bounce off of hard surfaces','random round in the magazine does increased damage'] Type = random.choice(['Shotgun','Sniper','Assault Rifle','Bow','Plasma Cannon','Bow']) Element = random.choice(['Fire','Ice','Lightning','Energy','Poison','Explosive']) Damage = random.randint(10,200) Range = random.randint(5,250) RoundsPerMinute = random.randint(60,900) Recoil = random.choice(['None','Light','Medium','Heavy']) Scope = random.choice(scopes) Rarity = random.choice(['common','rare','legendary','exclusive']) PerkLineA = random.sample(Perks,1) PerkLineB = random.sample(Perks,3) PerkLineC = random.sample(Perks,1) if Rarity == 'common': print(Rarity, Scope, Element, Type) print('Damage:',Damage) print('Range:',Range) print('recoil:',Recoil) print('RPM:',RoundsPerMinute) print('Perk Line A',PerkLineA) print('Perk Line B',PerkLineB) print('Perk Line C',PerkLineC) elif Rarity == 'rare': PerkLineD = random.sample(Perks,1) print(Rarity, Scope, Element, Type) print('Damage:',Damage) print('Range:',Range) print('recoil:',Recoil) print('RPM:',RoundsPerMinute) print('Perk Line A',PerkLineA) print('Perk Line B',PerkLineB) print('Perk Line C',PerkLineC) print('Perk Line D',PerkLineD) elif Rarity == 'legendary': Special = random.choice(['Yes','No']) if Special == 'Yes': Special = random.choice(['Lifestealer','Hypnotic','Holy','Demonic','Murderous','The living']) print(Special,Rarity,Scope,Element,Type) else: print(Rarity, Scope, Element, Type) PerkLineD = random.sample(Perks,3) print('Damage:',Damage) print('Range:',Range) print('recoil:',Recoil) print('RPM:',RoundsPerMinute) print('Perk Line A',PerkLineA) print('Perk Line B',PerkLineB) print('Perk Line C',PerkLineC) print('Perk Line D',PerkLineD) elif Rarity == 'exclusive': Special = random.choice(['Lifestealer','Hypnotic','Holy','Demonic','Murderous','The living']) print(Special,Rarity,Scope,Element,Type) PerkLineD = random.sample(Perks,3) PerkLineE = random.sample(Perks,3) print('Damage:',Damage) print('Range:',Range) print('recoil:',Recoil) print('RPM:',RoundsPerMinute) print('Perk Line A',PerkLineA) print('Perk Line B',PerkLineB) print('Perk Line C',PerkLineC) print('Perk Line D',PerkLineD) print('Perk Line E',PerkLineE)
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