subject

The function below tries to create a list of integers by reading them from a file. The file is expected to have a single integer per line and the code works correctly in that case. If any of the lines don't contain just an integer, than this code fails. Fix this code so that it ignores any lines that don't contain integers instead of raising an exception. Do this with try/except blocks. Your code should still return the list of integers from the lines that contain integers. student. py 1- def get list of_integers from_file(filename): int list - for line in open(filename).readlines (): int list. append (int (line)) return int list 12

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
Eye injuries usually occur as a result of all of the following things, except: a) proper machine operation b) battery explosion c) falling or flying debris d) electric welding arc
Answers: 2
question
Computers and Technology, 22.06.2019 10:40
5. illustrate how fine-line inventory classification can be used with product and market segments. what are the benefits and considerations when classifying inventory by product, market, and product/market?
Answers: 2
question
Computers and Technology, 22.06.2019 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
When designing content as part of your content marketing strategy, what does the "think" stage represent in the "see, think, do, care" framework?
Answers: 3
You know the right answer?
The function below tries to create a list of integers by reading them from a file. The file is expec...
Questions
question
Mathematics, 25.06.2019 08:30
Questions on the website: 13722363