Генератор аббревиатур
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- from random import choice
- d={'A':['Apple', 'Amsterdam', 'Actor'], 'B':['Barebone', 'Book', 'Best'], 'C':['Computer', 'Course', 'Cisco'], 'D':['Data', 'Document', 'Dog'],
- 'E':['Eagle', 'Egg', 'Elephant'], 'F':['Fire', 'Focus', 'Flying'], 'G':['Guide', 'Good', 'Glass'], 'H':['Hewlett', 'Hand', 'Hourse'],
- 'I':['Idle', 'In', 'It'], 'J':['Joke', 'January', 'Jeans'], 'K':['Kit', 'Knife', 'Knowledge'], 'L':['Like', 'Looking', 'Less'],
- 'M':['Motherboard', 'Macintosh', 'Map'], 'N':['Network', 'Nice', 'Nuckle'], 'O':['Orby', 'Out', 'Or'], 'P':['Packard', 'Protocol', 'Pig'],
- 'Q':['Quota', 'Quick', 'Quit'], 'R':['Red', 'Rock', 'Rose'], 'S':['Shine', 'Show', 'Shock'], 'T':['Terminal', 'Transformer', 'Tour'],
- 'U':['University', 'Universal', 'Unicode'], 'V':['View', 'Vapid', 'Vat'], 'W':['Weather', 'Wine', 'Warshark'], 'X':['Xeon', 'Xtreme', 'Xylophone'],
- 'Y':['Yellow', 'Yawn', 'Year'], 'Z':['Zoom', 'Zeal', 'Zoopark']}
- print "Введите Аббревиатуру"
- a=raw_input()
- b=a.upper()
- result = ''
- for letter in b:
- result += ' '+choice(d[letter])
- print "Query: %s" % a
- print "Result: %s" % result