Skip to content

Instantly share code, notes, and snippets.

@aster28
Created August 19, 2018 11:33
Show Gist options
  • Save aster28/c144e41dc73bcac264e318eb9103c30b to your computer and use it in GitHub Desktop.
Save aster28/c144e41dc73bcac264e318eb9103c30b to your computer and use it in GitHub Desktop.
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)
@aster28
Copy link
Author

aster28 commented Aug 19, 2018

picture2

@aster28
Copy link
Author

aster28 commented Aug 20, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment