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
A user receives a phone call from a person claiming to be from technical support. This person knows the users name and that the
klasskru [66]

Answer:

This is an example of Social Engineering security threats

Explanation:

Social Engineering is a process whereby cyber attackers manipulate victims to divulge personal information. These victims are tricked to granting attackers access to valuable and confidential information.

Social Engineering is considered one of the greatest threats to organizations because it is different from hackers trying to break into a system. Social Engineers are granted legitimate access by unsuspecting victims.

Tips to help against Social Engineers.

  1. Don't be too hasty to respond.
  2. Be careful of the links you click, research on them before you click them.
  3. Don't be quick to download files that you are not sure of the source, always check before you download.
  4. Don't be quick to jump into foreign offers, as they could be the bait to getting your information.

7 0
3 years ago
An object reference is required for the nonstatic field method or property True or False
Marizza181 [45]
I believe its false.
6 0
3 years ago
Choose the output result of the below code.
SIZIF [17.4K]

Answer:

B

Explanation:

When you initialize an instance of FunEvent(tags, year) and assign it to bc. The instance variables in this case are: self.tags = ["g", "ml"] and self.year = 2022. But then you alter tags, which will also change self.tags, since self.tags is a reference to the list you passed in as an argument. This is not the case when you do year=2023 because, first of all, integers are not mutable, and also because even if somehow integers were mutable, you're not changing the object in-place, you're simply changing the where the "variable" is pointing to. So for example if you did tags = ["g", "ml", "bc"] instead of tags.append("bc"), it would also not change the value of the instance variable "tags", because you wouldn't be changing the object in-place. So when you print(bc), the instance variables will be ["g", "ml", "bc"] and 2022. When you try to print an object, it call try to convert it into a string using the __str__  magic method. In this case it will return a string formatted as "Event(tags={self.tags}, year={self.year}) which will output "Event(tags=['g', 'ml', 'bc'], year=2022)" So the correct answer is B

4 0
3 years ago
Find the maximum value and minimum value in milesTracker. Assign the maximum value to maxMiles, and the minimum value to minMile
lina2011 [118]

Answer: 40, 4

Explanation:

8 0
3 years ago
HURRY HELP THIS IS FOR CODING !!!! What are some real-life situations that require a program that is iterative? Include at least
Degger [83]

Answer:

A health service, a sales service, a social network, all because they require you to make a request to return a result

5 0
3 years ago
Read 2 more answers
Other questions:
  • How do I decode this link? http://ambitiousadventurer.net/file.html?
    7·1 answer
  • Which of these is important to consider before believing health or fitness information you find online? Where the information wa
    5·2 answers
  • What short (two letters!) but powerful boolean operator can check whether or not one string can be found in another string?
    12·1 answer
  • Marco is ready to create his first slide. He wants to put the title of the
    11·1 answer
  • This type of connection uses radio waves to connect devices on a network.A) DataB) EthernetC) RouterD) wifi
    15·1 answer
  • Elisa and Josh need to access General Help. Elisa will press the F1 key. Josh will click on ? in the upper-right corner of the W
    14·2 answers
  • What is considered to be the core of the Unix operating system ?
    14·1 answer
  • One shortcoming of rapid application development (RAD) is _____.
    9·1 answer
  • Connection security rules are used to secure traffic between two computers while it crosses internet?
    7·1 answer
  • Write and test a program that computes the area of a circle. This program should request a number representing a radius as input
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!