1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leno4ka [110]
3 years ago
15

Write a program that reads in a text file, infile.txt, and prints out all the lines in the file to the screen until it encounter

s a line with fewer than 4 characters. Once it finds a short line (one with fewer than 4 characters), the program stops. Your program must use readline() to read one line at a time. For your testing you should create a file named infile.txt. Only upload your Python program, I will create my own infile.txt using break
Computers and Technology
1 answer:
ivanzaharov [21]3 years ago
8 0

Answer:

Explanation:

f=open("infile.txt","r")

flag=True

while(flag):

s=f.readline().strip()

if(len(s)>=4):

print(s)

else:

flag=False

You might be interested in
व्याख्या c) Differentiate between Raster Image and Vector Image.​
crimeas [40]

Vector images are described by lines, shapes, and other graphic image components stored in a format that incorporates geometric formulas for rendering the image elements

These are the types of images that are produced when scanning or photographing an object. Raster images are compiled using pixels, or tiny dots, containing unique color and tonal information that come together to create the image.

7 0
3 years ago
What makes manually cleaning data challenging?
Alexxandr [17]

Manually cleaning data is done manually which makes it challenging. This make it prone to mistakes.

6 0
3 years ago
why is this message poor or ineffective ,Due to low profits,there will be no annual year-end bonus this year. We hope to have a
Annette [7]
If it's a holiday, you should be getting a year-end bonus. They hope for you to have a new year when you aren't getting a bonus!
8 0
3 years ago
Read 2 more answers
Why are video games interesting?
TiliK225 [7]
Because there fun and helps boys get together or to get ur mind off of stuff
5 0
3 years ago
In your opinion, why did Proponents<br>of IPs used IPV6 instead of IPv5​
frutty [35]

Answer:

The following where many reasons why IPv6 was used instead of IPv5 which are the limitation of it's 32 bit address, IPv5 began or used with a different name called Internet streaming, IPv6 provides unlimited addressing, because it comprises of 128 bit.

Explanation:

Solution:

The following reasons why Proponents  of IPs used IPV6 instead of IPv5​ is stated as follows:

  • Due to its limited 32 bit addressing
  • IPv6 offers almost unlimited addressing because of its 128-bit addressing
  • IPv5 started under a different name which is internet stream(ST)
  • ST(Internet streaming) was developed for streaming video and voice
  • ST was developed by Apple, NeXT, and Sun Microsystems
  • ST was effective on specific frequency to carry out communication
5 0
3 years ago
Other questions:
  • In the 2007/2010 version of Paint, which of the following tools are located in the View tab? (Select all that apply.)
    5·1 answer
  • What your computer can do to you?
    14·2 answers
  • Write a paragraph on the following topic.
    14·1 answer
  • Describe how electrons move between atoms to create electricity.
    7·2 answers
  • The term "exception propagation" means:
    5·1 answer
  • The total number of possible keys for des is _________, which a modern computer system can break in a reasonable amount of time.
    10·1 answer
  • What is the best definition of a network?
    14·2 answers
  • Match the feature to its function.
    7·1 answer
  • How is scale depicted on a flat video screen?
    13·1 answer
  • In a paragraph discuss 5 steps of saving a document in a storage device.<br>​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!