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
dezoksy [38]
3 years ago
8

Write a program that Read first n lines of file

Computers and Technology
1 answer:
sergejj [24]3 years ago
7 0

Answer:

Python 2:

with open("datafile") as myfile:

   head = [next(myfile) for x in xrange(N)]

print head

Python 3:

with open("datafile") as myfile:

   head = [next(myfile) for x in range(N)]

print(head)

Both Python 2 & 3:

from itertools import islice

with open("datafile") as myfile:

   head = list(islice(myfile, N))

print head

You might be interested in
Care and feeding for computer
o-na [289]
Don’t drop it and charge it regularly
5 0
3 years ago
POINT AND BRAINLIEIST GIVE AWAY!!!
Sonbull [250]

Answer:

Hey whats up

Explanation:

Count me in chief! I love when fellow user give out mighty points

7 0
3 years ago
Read 2 more answers
Identify the following verb by number and person by checking on the appropriate boxes.
Makovka662 [10]
Second person ig Imao yeah
3 0
2 years ago
Read 2 more answers
Pick a web browser (a leading one or perhaps a lesser-known one that you use) and examine the Privacy and Security features and
Veseljchak [2.6K]

Solution :

<u>Chrome web browser</u>

The Chrome web browser uses a range of privacy and security settings for its customers. They include several security indicators as well as malware protection. Chrome uses the sandboxing technology, which prevents the harmful viruses and Trojans from reaching the computers.

Chrome provides a safe browsing by giving us an alert whenever we try to browse some harmful web sites.  It also warns you if we use a username and password combination which has been compromised in any data leak.

Chrome also serves to protect the individuals :

It provides a features of Ad blocking.

When we want to browse safely without being recognized or without storing any credentials, Chrome provides an Incognito mode.

Many businesses can be done on the internet using Chrome platform that is safe and authenticate to gather and collect data and information.

3 0
3 years ago
_______ allows you to add formatting such as shapes and colors to text. a. worddraw b. wordart c. worddesign d. wordshapes
4vir4ik [10]
Word Design is the answer.
4 0
3 years ago
Read 2 more answers
Other questions:
  • why is it important to use a general search engine, like GOOGLE, to look up the name of the organization, institution, agency or
    7·1 answer
  • What is industry 4.0 -automation revolution-, what is your opinion about the direction this revolution is taking the industry in
    8·1 answer
  • Given the security levels TOP SECRET, SECRET, CONFIDENTIAL, and UNCLASSIFIED (ordered from highest to lowest), and the categorie
    13·1 answer
  • Which of the following is something you need to keep an eye out for
    7·2 answers
  • Hey does anybody know how to delete history on a school-issued chrome book, I tried to delete it but it won't let you clear your
    7·1 answer
  • A Tracking Gantt chart is based on the percentage of work completed for project tasks or the actual start and finish dates. True
    12·1 answer
  • It is possible to limit the search results to a range of publication dates.
    13·1 answer
  • What is a Slide Master? A. the placeholder used to insert objects B. the sequence of slides in a presentation C. the default des
    14·1 answer
  • I need to calculate the % of Grand Total on Microsoft Excel, but can't for the life of me remember how to do that. Help would be
    8·1 answer
  • Consider the following code snippet that appears in a subclass: public void deposit(double amount) { transactionCount ++; deposi
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!