Find all possible combinations of a specific word (string) using any
combination of upper case and lower case letters with a for loop (no
itertools).
An example:
string_input = hat
comboination = ['hat', 'Hat', 'HAt', 'HAT', 'hAT', 'haT', 'HaT', 'hAt']
What I've tried so far, I’m trying to do this using knowledge from loops, if
and else, strings and lists.
gear = ['hat']
for i in range(len(gear[0])):
gearlist1 = list(gear[0])
gearlist2 = [c.upper() for c in gearlist1]
gearlist3 = [gearlist1[0].join(gearlist2)]
print 'list is: %r' % (gearlist3 ,),
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor