Skip to content

Instantly share code, notes, and snippets.

View pylearner1007's full-sized avatar

Jawad Qadir pylearner1007

View GitHub Profile
@pylearner1007
pylearner1007 / 01.py
Created April 11, 2023 19:07
def get_words(sentence, n):
def get_word(sentence, n):
# Only proceed if n is positive
if n > 0:
words = ___
# Only proceed if n is not more than the number of words
if n <= len(words):
return(___)
return("")
print(get_word("This is a lesson about lists", 4)) # Should print: lesson