Skip to content

Commit

Permalink
Solution for issue #3 (#147)
Browse files Browse the repository at this point in the history
* Solution for issue #1

* Create mutations_ljsauer.py

* Revert "Solution for issue #1"

This reverts commit 3907bbd.
  • Loading branch information
ljsauer authored and the-vampiire committed Oct 21, 2019
1 parent 45e1662 commit 568e927
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions python/intermediate/mutations_ljsauer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
Challenge: Write a function that returns True if the first string in a list
contains all of the letters of the second string in the list.
Examples:
["hello", "hey"]
should return false because the string "hello" does not contain a "y".
["alien", "line"]
should return true because all of the letters in "line" are present in "Alien".
"""

def all_there():

print("This function takes two words as input and checks to see if " +
"all the letters in Word 2 are in Word 1.")

strings = input("Enter two words, separated by a comma (no spaces): ").lower().split(',')
word1 = strings[0]
word2 = strings[1]

print("You entered,", word1, " and", word2)

for i in word2:
if i in word1:
return True
else:
return False

0 comments on commit 568e927

Please sign in to comment.