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]
2 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]2 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
Employees often attend trainings and read policies. They endure these, but do not internalize them. What should be your first st
Vlada [557]

Answer:

I would say b but if I'm wrong take the point back

7 0
2 years ago
Is C++ a high-level or low-level programming language? What about HTML?
N76 [4]

Answer:

c++ is low level

html high level

Explanation:

6 0
2 years ago
What is CPU<br>and it's functions<br>​
BartSMP [9]

Answer:

CPU is considered as the brain of the computer. CPU performs all types of data processing operations. It stores data, intermediate results, and instructions (program). It controls the operation of all parts of the computer

5 0
2 years ago
Read 2 more answers
Define a function called strip_punctuation which takes one parameter, a string which represents a word, and removes characters c
DaniilM [7]

Answer:

punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@']

def strip_punctuation(strWord):

   for charPunct in punctuation_chars:

       strWord = strWord.replace(charPunct, "")

   return strWord

Explanation:

The function is defined with a single argument.

A for loop is ran to check each character of the the word.

If a punction mark is present as a character in the word, it is removed.

The same word is returned but without the punctuation marks.

8 0
3 years ago
when searching for a peer-reviewed journal article, you see the phrase "full text available" in the item record. what does this
Stells [14]

Answer: pay a fee for the whole paper

Explanation:

"Full text available" sometimes alludes to the fact that they have the paper available, but for a price. You must click on this button to view the entire paper instead of just a summary or abstract.

4 0
3 years ago
Other questions:
  • Write a method called printRange that accepts two integers as arguments and prints the sequence of numbers between the two argum
    6·1 answer
  • What does "ttyt" stand for?
    13·2 answers
  • What advantage does a circuit-switched network have over a packet-switched network? What advantages does TDM have over FDM in a
    6·1 answer
  • python There is a reference variable office_a_c of type AirConditioner. Create a new object of type AirConditioner using the off
    9·1 answer
  • Disrupting a business's ability to conduct electronic commerce is cönsidered an act of
    6·1 answer
  • etwork behavior analysis system __________ sensors are typically intended for network perimeter use, so they are deployed in clo
    10·1 answer
  • Select the correct navigational path to set the name for a cell range.
    15·2 answers
  • Na2CO3 → Na2O + what
    13·2 answers
  • I will give brainyest
    15·2 answers
  • balance exercises used for introducing balance training should initially involve little joint motion and improve what type of co
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!