import string
import random

def generate_string(str_len=6, src=string.ascii_lowercase):
    return "".join(random.choice(src) for x in xrange(str_len))

def lorem_ipsum():
    words_count = random.randint(20, 50)
    lorem = list([])
    for i in xrange(words_count):
        word_length = random.randint(4, 8)
        lorem.append(generate_string(str_len=word_length))
    return " ".join(lorem)

import string
import random


def generate_string(str_len=6, src=string.ascii_lowercase):
    return "".join(random.choice(src) for x in xrange(str_len))


def lorem_ipsum(words_count=30):
    lorem = list([])
    for i in xrange(words_count):
        word_length = random.randint(4, 8)
        lorem.append(generate_string(str_len=word_length))
    return " ".join(lorem)

Add word_count parameter for lorem_ipsum generator
Add word_count parameter for lorem_ipsum generator

  import string
  import random
+ 
  
  def generate_string(str_len=6, src=string.ascii_lowercase):
      return "".join(random.choice(src) for x in xrange(str_len))
  
- def lorem_ipsum():
-     words_count = random.randint(20, 50)
+ 
+ def lorem_ipsum(words_count=30):
      lorem = list([])
      for i in xrange(words_count):
          word_length = random.randint(4, 8)
          lorem.append(generate_string(str_len=word_length))
      return " ".join(lorem)
  
Add word_count parameter for lorem_ipsum generator
## Code Before:
import string
import random

def generate_string(str_len=6, src=string.ascii_lowercase):
    return "".join(random.choice(src) for x in xrange(str_len))

def lorem_ipsum():
    words_count = random.randint(20, 50)
    lorem = list([])
    for i in xrange(words_count):
        word_length = random.randint(4, 8)
        lorem.append(generate_string(str_len=word_length))
    return " ".join(lorem)

## Instruction:
Add word_count parameter for lorem_ipsum generator
## Code After:
import string
import random


def generate_string(str_len=6, src=string.ascii_lowercase):
    return "".join(random.choice(src) for x in xrange(str_len))


def lorem_ipsum(words_count=30):
    lorem = list([])
    for i in xrange(words_count):
        word_length = random.randint(4, 8)
        lorem.append(generate_string(str_len=word_length))
    return " ".join(lorem)
