Premium Only Content
This video is only available to Rumble Premium subscribers. Subscribe to
enjoy exclusive content and ad-free viewing.

Opening and Reading a File |Section 5| Celestial Warrior
2 years ago
1
Please download the text file from the attachment.
Then write some code that reads the content of the file andgenerates the following output in the command line:
pear
apple
orange
mandarin
watermelon
pomegranate
file = open("fruits.txt", "r")
content = file.read()
file.close()
print(content)
Please modify thecode of the previous exerciseso that instead of printing out thelines in the terminal, it prints out the length of each line.
Expected output:
4
5
6
8
10
11
file = open("fruits.txt", "r")
content = file.readlines()
file.close()
for i in content:
print(len(i.strip()))
Loading comments...
-
17:53
foyo Games
2 years agoShadow Era | Shadow Warrior Opening
4 -
1:02:48
BonginoReport
3 hours agoChristianity Is Under Attack - Nightly Scroll w/ Hayley Caronia (Ep.144)
39.1K42 -
1:05:10
The Nick DiPaolo Show Channel
4 hours agoKirk Assassination Theories Abound! | The Nick Di Paolo Show #1795
27.4K27 -
41:09
Katie Miller Pod
17 hours ago $0.95 earnedEpisode 8 - Adena Friedman | The Katie Miller Podcast
16.8K -
GritsGG
6 hours agoDuos! Most Wins in WORLD! 3680+!
10.6K -
1:45:18
Kim Iversen
3 hours agoSnake Eyes to Charlie Kirk: Is Life Copying this Hollywood Script?
34K39 -
1:05:24
TheCrucible
3 hours agoThe Extravaganza! EP: 44 (9/29/25)
102K9 -
1:39:07
Redacted News
4 hours agoThe FBI's Charlie Kirk assassination story has fully collapsed as new details emerge | Redacted News
156K152 -
1:15:20
vivafrei
6 hours agoLive with The Blaze's Steve Baker: Jan. 6 Fed-Surrection and Patel's Clarification Adds Confusion!
173K43 -
LIVE
Futures Edge: Finance Unfiltered with Jim Iuorio and Bob Iaccino
4 hours ago $1.43 earnedSeptember Surge: What It Means for Q4
54 watching