Skip to content

Commit

Permalink
Add get_character
Browse files Browse the repository at this point in the history
  • Loading branch information
alexchantastic committed Nov 3, 2021
1 parent 31d5176 commit 3dd5703
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lipsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@
type = args[1]
count = int(args[2]) if len(args) >= 3 else 1

def get_character(count):
pool = lorem.get_word(1)

while len(pool) <= count:
pool += ' ' + lorem.get_word(1)

return pool[0:count]

def lipsum(type):
if type == 'characters':
return ''
return get_character(count).capitalize()

elif type == 'words':
return lorem.get_word(count).capitalize()
Expand Down

0 comments on commit 3dd5703

Please sign in to comment.