Skip to content

Instantly share code, notes, and snippets.

@managedkaos
Last active Apr 10, 2021
Embed
What would you like to do?
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut velit eros, lobortis a sem et, semper imperdiet quam. Morbi vitae mauris congue, laoreet tortor et, tincidunt nunc. Vestibulum pulvinar, erat ut laoreet bibendum, nunc velit semper dui, non euismod enim risus vitae sapien. Vivamus ultrices consequat urna in commodo. Sed mattis, lectus vestibulum faucibus viverra, lacus orci lacinia erat, quis bibendum nisl libero a ipsum. Praesent mollis a mi non vestibulum. Duis vel arcu purus. Curabitur ornare tortor vel convallis efficitur. Donec tempus massa eget imperdiet cursus. Quisque purus leo, varius eget mollis eu, blandit vitae quam. Vivamus egestas interdum sollicitudin. In vitae nulla diam. Morbi ante leo, tristique eu rutrum in, tempus et justo.
Nunc sed massa magna. Quisque vestibulum cursus nisl vitae malesuada. Maecenas id neque eu quam facilisis vehicula. Cras tempus consectetur eros a lobortis. Nunc semper iaculis lectus. Quisque at nunc vel ligula eleifend posuere at eget ex. Vivamus varius mauris nec nunc auctor molestie. Integer eget nunc hendrerit, porttitor nibh et, rutrum libero. Proin vitae leo in diam sollicitudin accumsan ut ut mi. Donec fringilla odio fermentum eros posuere, non pulvinar nulla ullamcorper. Aliquam enim dolor, maximus vulputate nibh et, finibus maximus erat. Mauris dictum fermentum tempor. Praesent dolor mauris, bibendum vel interdum tincidunt, tempor a leo. Ut laoreet nec turpis eget dictum.
Mauris sollicitudin arcu at luctus ultricies. Quisque nec ligula dolor. Vestibulum cursus congue euismod. Mauris nulla ligula, efficitur at sagittis eu, sodales ut dui. Maecenas gravida leo ligula, non malesuada augue commodo et. Cras porttitor quam posuere blandit egestas. Nulla gravida libero non imperdiet vestibulum. Maecenas condimentum congue enim quis tristique. Vivamus pulvinar tortor id eros convallis ultricies. Phasellus euismod imperdiet nibh, in consectetur mi viverra ut. Fusce ullamcorper quam ac augue tincidunt, nec viverra sapien sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse dapibus urna diam, a auctor tellus pulvinar vitae.
Pellentesque eu congue quam, quis placerat ligula. Nam vulputate tincidunt lectus, sit amet tempus massa congue luctus. Phasellus consequat, arcu eget ultrices blandit, mauris dolor placerat urna, vel elementum diam ipsum at velit. Sed auctor vel nulla at ornare. Vestibulum non velit vitae nisl commodo blandit. Suspendisse in gravida quam. Etiam quis rutrum risus. Curabitur molestie, sem ut maximus volutpat, lectus erat molestie magna, et scelerisque massa elit vel dui. Phasellus tincidunt interdum pellentesque. Maecenas lobortis commodo ultrices. In consectetur tempor neque, ut cursus lacus ultrices at. Sed quis luctus dui.
Morbi blandit ac ligula et ultrices. Sed sit amet viverra metus. Proin vitae mollis lectus. In convallis efficitur magna at dapibus. Vestibulum iaculis a diam sit amet lobortis. Etiam in tincidunt urna, eu mattis ligula. Nulla at massa nec orci pretium convallis. Nullam sollicitudin fringilla leo, ac fermentum ipsum luctus eu. Aliquam eget lorem nec arcu pretium venenatis at non sapien.
lookup = {"lorem":"LOREM"}
def process_the_file(filename):
# Open the file passed in as the filename argument
f = open(filename,"r")
# Read all the lines in the file into a list
lines = f.readlines()
# Process each line stored in the list named lines
# Process means: print it and then split it into words
for line in lines:
# Print the line
print("line is {}".format(line))
# Split the line on spaces and store the words into a list named words
words = line.split(" ")
# Process each word stored in the list named words
# Process means: print it and then look it up using the lookup variable
for word in words:
print("word is {}".format(word))
if word in lookup:
print("i found the word {} and capitalized it: {}".format(word, lookup[word]))
else:
# the keyword 'pass' let's you not do anything
pass
process_the_file("0-file.txt")
line is Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut velit eros, lobortis a sem et, semper imperdiet quam. Morbi vitae mauris congue, laoreet tortor et, tincidunt nunc. Vestibulum pulvinar, erat ut laoreet bibendum, nunc velit semper dui, non euismod enim risus vitae sapien. Vivamus ultrices consequat urna in commodo. Sed mattis, lectus vestibulum faucibus viverra, lacus orci lacinia erat, quis bibendum nisl libero a ipsum. Praesent mollis a mi non vestibulum. Duis vel arcu purus. Curabitur ornare tortor vel convallis efficitur. Donec tempus massa eget imperdiet cursus. Quisque purus leo, varius eget mollis eu, blandit vitae quam. Vivamus egestas interdum sollicitudin. In vitae nulla diam. Morbi ante leo, tristique eu rutrum in, tempus et justo.
word is Lorem
word is ipsum
word is dolor
word is sit
word is amet,
word is consectetur
word is adipiscing
word is elit.
word is Ut
word is velit
word is eros,
word is lobortis
word is a
word is sem
word is et,
word is semper
word is imperdiet
word is quam.
word is Morbi
word is vitae
word is mauris
word is congue,
word is laoreet
word is tortor
word is et,
word is tincidunt
word is nunc.
word is Vestibulum
word is pulvinar,
word is erat
word is ut
word is laoreet
word is bibendum,
word is nunc
word is velit
word is semper
word is dui,
word is non
word is euismod
word is enim
word is risus
word is vitae
word is sapien.
word is Vivamus
word is ultrices
word is consequat
word is urna
word is in
word is commodo.
word is Sed
word is mattis,
word is lectus
word is vestibulum
word is faucibus
word is viverra,
word is lacus
word is orci
word is lacinia
word is erat,
word is quis
word is bibendum
word is nisl
word is libero
word is a
word is ipsum.
word is Praesent
word is mollis
word is a
word is mi
word is non
word is vestibulum.
word is Duis
word is vel
word is arcu
word is purus.
word is Curabitur
word is ornare
word is tortor
word is vel
word is convallis
word is efficitur.
word is Donec
word is tempus
word is massa
word is eget
word is imperdiet
word is cursus.
word is Quisque
word is purus
word is leo,
word is varius
word is eget
word is mollis
word is eu,
word is blandit
word is vitae
word is quam.
word is Vivamus
word is egestas
word is interdum
word is sollicitudin.
word is In
word is vitae
word is nulla
word is diam.
word is Morbi
word is ante
word is leo,
word is tristique
word is eu
word is rutrum
word is in,
word is tempus
word is et
word is justo.
line is
word is
line is Nunc sed massa magna. Quisque vestibulum cursus nisl vitae malesuada. Maecenas id neque eu quam facilisis vehicula. Cras tempus consectetur eros a lobortis. Nunc semper iaculis lectus. Quisque at nunc vel ligula eleifend posuere at eget ex. Vivamus varius mauris nec nunc auctor molestie. Integer eget nunc hendrerit, porttitor nibh et, rutrum libero. Proin vitae leo in diam sollicitudin accumsan ut ut mi. Donec fringilla odio fermentum eros posuere, non pulvinar nulla ullamcorper. Aliquam enim dolor, maximus vulputate nibh et, finibus maximus erat. Mauris dictum fermentum tempor. Praesent dolor mauris, bibendum vel interdum tincidunt, tempor a leo. Ut laoreet nec turpis eget dictum.
word is Nunc
word is sed
word is massa
word is magna.
word is Quisque
word is vestibulum
word is cursus
word is nisl
word is vitae
word is malesuada.
word is Maecenas
word is id
word is neque
word is eu
word is quam
word is facilisis
word is vehicula.
word is Cras
word is tempus
word is consectetur
word is eros
word is a
word is lobortis.
word is Nunc
word is semper
word is iaculis
word is lectus.
word is Quisque
word is at
word is nunc
word is vel
word is ligula
word is eleifend
word is posuere
word is at
word is eget
word is ex.
word is Vivamus
word is varius
word is mauris
word is nec
word is nunc
word is auctor
word is molestie.
word is Integer
word is eget
word is nunc
word is hendrerit,
word is porttitor
word is nibh
word is et,
word is rutrum
word is libero.
word is Proin
word is vitae
word is leo
word is in
word is diam
word is sollicitudin
word is accumsan
word is ut
word is ut
word is mi.
word is Donec
word is fringilla
word is odio
word is fermentum
word is eros
word is posuere,
word is non
word is pulvinar
word is nulla
word is ullamcorper.
word is Aliquam
word is enim
word is dolor,
word is maximus
word is vulputate
word is nibh
word is et,
word is finibus
word is maximus
word is erat.
word is Mauris
word is dictum
word is fermentum
word is tempor.
word is Praesent
word is dolor
word is mauris,
word is bibendum
word is vel
word is interdum
word is tincidunt,
word is tempor
word is a
word is leo.
word is Ut
word is laoreet
word is nec
word is turpis
word is eget
word is dictum.
line is
word is
line is Mauris sollicitudin arcu at luctus ultricies. Quisque nec ligula dolor. Vestibulum cursus congue euismod. Mauris nulla ligula, efficitur at sagittis eu, sodales ut dui. Maecenas gravida leo ligula, non malesuada augue commodo et. Cras porttitor quam posuere blandit egestas. Nulla gravida libero non imperdiet vestibulum. Maecenas condimentum congue enim quis tristique. Vivamus pulvinar tortor id eros convallis ultricies. Phasellus euismod imperdiet nibh, in consectetur mi viverra ut. Fusce ullamcorper quam ac augue tincidunt, nec viverra sapien sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse dapibus urna diam, a auctor tellus pulvinar vitae.
word is Mauris
word is sollicitudin
word is arcu
word is at
word is luctus
word is ultricies.
word is Quisque
word is nec
word is ligula
word is dolor.
word is Vestibulum
word is cursus
word is congue
word is euismod.
word is Mauris
word is nulla
word is ligula,
word is efficitur
word is at
word is sagittis
word is eu,
word is sodales
word is ut
word is dui.
word is Maecenas
word is gravida
word is leo
word is ligula,
word is non
word is malesuada
word is augue
word is commodo
word is et.
word is Cras
word is porttitor
word is quam
word is posuere
word is blandit
word is egestas.
word is Nulla
word is gravida
word is libero
word is non
word is imperdiet
word is vestibulum.
word is Maecenas
word is condimentum
word is congue
word is enim
word is quis
word is tristique.
word is Vivamus
word is pulvinar
word is tortor
word is id
word is eros
word is convallis
word is ultricies.
word is Phasellus
word is euismod
word is imperdiet
word is nibh,
word is in
word is consectetur
word is mi
word is viverra
word is ut.
word is Fusce
word is ullamcorper
word is quam
word is ac
word is augue
word is tincidunt,
word is nec
word is viverra
word is sapien
word is sodales.
word is Pellentesque
word is habitant
word is morbi
word is tristique
word is senectus
word is et
word is netus
word is et
word is malesuada
word is fames
word is ac
word is turpis
word is egestas.
word is Suspendisse
word is dapibus
word is urna
word is diam,
word is a
word is auctor
word is tellus
word is pulvinar
word is vitae.
line is
word is
line is Pellentesque eu congue quam, quis placerat ligula. Nam vulputate tincidunt lectus, sit amet tempus massa congue luctus. Phasellus consequat, arcu eget ultrices blandit, mauris dolor placerat urna, vel elementum diam ipsum at velit. Sed auctor vel nulla at ornare. Vestibulum non velit vitae nisl commodo blandit. Suspendisse in gravida quam. Etiam quis rutrum risus. Curabitur molestie, sem ut maximus volutpat, lectus erat molestie magna, et scelerisque massa elit vel dui. Phasellus tincidunt interdum pellentesque. Maecenas lobortis commodo ultrices. In consectetur tempor neque, ut cursus lacus ultrices at. Sed quis luctus dui.
word is Pellentesque
word is eu
word is congue
word is quam,
word is quis
word is placerat
word is ligula.
word is Nam
word is vulputate
word is tincidunt
word is lectus,
word is sit
word is amet
word is tempus
word is massa
word is congue
word is luctus.
word is Phasellus
word is consequat,
word is arcu
word is eget
word is ultrices
word is blandit,
word is mauris
word is dolor
word is placerat
word is urna,
word is vel
word is elementum
word is diam
word is ipsum
word is at
word is velit.
word is Sed
word is auctor
word is vel
word is nulla
word is at
word is ornare.
word is Vestibulum
word is non
word is velit
word is vitae
word is nisl
word is commodo
word is blandit.
word is Suspendisse
word is in
word is gravida
word is quam.
word is Etiam
word is quis
word is rutrum
word is risus.
word is Curabitur
word is molestie,
word is sem
word is ut
word is maximus
word is volutpat,
word is lectus
word is erat
word is molestie
word is magna,
word is et
word is scelerisque
word is massa
word is elit
word is vel
word is dui.
word is Phasellus
word is tincidunt
word is interdum
word is pellentesque.
word is Maecenas
word is lobortis
word is commodo
word is ultrices.
word is In
word is consectetur
word is tempor
word is neque,
word is ut
word is cursus
word is lacus
word is ultrices
word is at.
word is Sed
word is quis
word is luctus
word is dui.
line is
word is
line is Morbi blandit ac ligula et ultrices. Sed sit amet viverra metus. Proin vitae mollis lectus. In convallis efficitur magna at dapibus. Vestibulum iaculis a diam sit amet lobortis. Etiam in tincidunt urna, eu mattis ligula. Nulla at massa nec orci pretium convallis. Nullam sollicitudin fringilla leo, ac fermentum ipsum luctus eu. Aliquam eget lorem nec arcu pretium venenatis at non sapien.
word is Morbi
word is blandit
word is ac
word is ligula
word is et
word is ultrices.
word is Sed
word is sit
word is amet
word is viverra
word is metus.
word is Proin
word is vitae
word is mollis
word is lectus.
word is In
word is convallis
word is efficitur
word is magna
word is at
word is dapibus.
word is Vestibulum
word is iaculis
word is a
word is diam
word is sit
word is amet
word is lobortis.
word is Etiam
word is in
word is tincidunt
word is urna,
word is eu
word is mattis
word is ligula.
word is Nulla
word is at
word is massa
word is nec
word is orci
word is pretium
word is convallis.
word is Nullam
word is sollicitudin
word is fringilla
word is leo,
word is ac
word is fermentum
word is ipsum
word is luctus
word is eu.
word is Aliquam
word is eget
word is lorem
i found the word lorem and capitalized it: LOREM
word is nec
word is arcu
word is pretium
word is venenatis
word is at
word is non
word is sapien.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment