Write a program that will only read every other line of an external file.
open file poem.txt
read one line of the poem at a time
output every other line of the poem on screen
Poem.txt copy & paste into a external text file and place the file in the same folder as your Python program
I must not fear.
Fear is the mind-killer.
Fear is the little-death that brings total obliteration.
I will face my fear.
I will permit it to pass over me and through me.
And when it has gone past I will turn the inner eye to see its path.
Where the fear has gone there will be nothing.
Only I will remain.
Write a program that will read an external file of super hereos, sort them and output them in sorted order on screen.ย
open & read data from a text file called avengers.txt
append each hereo to an array
close file
sort array
output each array element in sorted order on the screenย
avengers.txt copy & paste into a external text file and place the file in the same folder as your Python program
๏ปฟIron man
Hulk
Captain America
Black Widow
Thor
Hawkeye
Loki
Ant Man
The Wasp
Spiderman
Captain Marvel
Doctor Strange
Nebular
War Machine
Valkyrie
Bucky Barnes
Star-Lord
Black Panther
Ancient One
Howard the Duck
Okoye
Rocket Racoon
Drax the Destroyer
Shuri
Wong
Happy Hogan
Pepper Potts
Scarlet Witch
Falcon
Gamora
Vison
Nick Fury
Groot
Mantis
Hank Pym
Yondu
Further develop your previous program by:
opening and reading the justice league external file
appending new hereos to the existing array of super heroes
re-sorting the array
write data into a new file called updated-superheroes.txt
justice league.txt copy & paste into a external text file and place the file in the same folder as your Python program
Green Lantern
Flash
Superman
Batman
Wonder Woman
Aquaman
Martian Manhunter