Created
August 19, 2018 11:33
-
-
Save aster28/c144e41dc73bcac264e318eb9103c30b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var1, var2, var3, var4 = input("Enter BETWEEN APPLE, MANGO, GUAVA, ORANGE here: ").split() | |
target =[] | |
t={"apple":1,"orange":1,"mango":1,"guava":1} | |
f = open('words.txt') | |
for word in f.read().split(): | |
if var1 in word: | |
for key, value in t.items() : | |
if key in var1: | |
target.append(value) | |
if var2 in word: | |
for key, value in t.items() : | |
if key in var2: | |
target.append(value) | |
if var3 in word: | |
for key, value in t.items() : | |
if key in var3: | |
target.append(value) | |
if var4 in word: | |
for key, value in t.items() : | |
if key in var4: | |
target.append(value) | |
print(target) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A text file is a kind of computer file that guava is structured as a sequence of lines of electronic text. A text file exists stored as data within a computer file system. The end of a text file is often denoted by placing one or more special characters, known as an end-of-file marker, after the last line in a text file. Such markers were required under the CP/M and MS-DOS operating systems.
On modern operating systems such as Windows and Unix-like systems, text files do not contain any special EOF ch
apple