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
Wewaii [24]
2 years ago
13

The Linux tail command prints the last maximum n lines of a file. When writing a function that performs this function, choose th

e correct statements that can go in the ?????.
lines[-n]

lines[-n:]

lines[len(lines)-n:]

lines[-1:-n-1:-1]

lines.pop(n)

Computers and Technology
1 answer:
goldenfox [79]2 years ago
3 0

The Linux tail command prints the last maximum n lines of a file. When writing a function that performs this function, in this case is lines[-n:].

<h3>Writing code in Linux:</h3>

<em>def tail(filename, n=10) :</em>

<em>  with open(filename, "r") as </em>

<em>      lines = f.readlines()</em>

<em>   for line in lines[-n:] : </em>

<em>     print (lines) </em>

See more about linux at brainly.com/question/15122141

#SPJ1

You might be interested in
how is a two-dimensional array different from a traditional one dimensional array? From an ArrayList?
mrs_skeptik [129]
An ArrayList is just like a 1D Array except it's length is unbounded and you can add as many elements as you need. The only difference when making a 2D array is that you now have two sets of brackets, the first one representing the number of rows you want and the second representing your columns.
6 0
3 years ago
Which of the following is used by a seller to deceive a buyer? a. bait and switch b. contest c. display d. introductory offer
notka56 [123]
The answer to this question is A. bait and switch.
4 0
4 years ago
Read 2 more answers
Which of these methods returns a random number?
Olenka [21]
D randgenerator
i just need 20 characters

6 0
3 years ago
In a(n) ____, the programmer uses a programming language (in context free grammar) to tell the computer what to accomplish and h
Mamont248 [21]

A 5GL fifth-generation languages a programming language design to solve given problem without programmer. The user only needs to solve the problem and condition without implementing an algorithm.

Explanation:

First Generation Language

The first generation language is called low- level style because they were used at a superficial level of abstraction. First-generation language referred to as the native language.

Second Generation Language

The second-generation language is also low-level language or assembly language. The second level of language uses the concept of mnemonics for the writing program. Symbolic name are used.

Third Generation Language

The third-generation language overcomes the first and second-generation languages. Third generation language is considered as high- level language because the target is to focus on the logic of the program.

Fourth Generation Language

The language of generation required a lot of time and effort that affect programmers.The fourth-generation was developed to reduce the time, cost, and effort.

Fifth Generation Language

The programming language of this generation focuses on constraints programming. The fifth-generation programming languages are Artificial Intelligence and Artificial Neural Network.

6 0
3 years ago
Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear. Sample output:
Juliette [100K]

Answer:

#include <iostream>

using namespace std;

class DogLicense{

   public:

       void SetYear(int yearRegistered);

       void CreateLicenseNum(int customID);

       int GetLicenseNum() const;

   private:

       int licenseYear;

       int licenseNum;

};

void DogLicense::SetYear(int yearRegistered) {

   licenseYear = yearRegistered;

}

void DogLicense::CreateLicenseNum(int customID) {

   licenseNum = (100000 * customID) + licenseYear;

}

int DogLicense::GetLicenseNum() const {

   return licenseNum;

}

int main() {

   DogLicense dog1;

   dog1.SetYear(2014);

   dog1.CreateLicenseNum(777);

   cout << "Dog license: " << dog1.GetLicenseNum() << endl;

return 0;

}

Explanation:

You can see the whole code above, but let me explain the fixed function.

void DogLicense::CreateLicenseNum(int customID) {

   licenseNum = (100000 * customID) + licenseYear;

}

The function header is already declared in the class. It takes <em>customID</em> as a parameter. To find out the <em>lisenseNum</em>, we need to apply the given formula <em><u>(100000 * customID) + licenseYear</u></em>.

6 0
4 years ago
Read 2 more answers
Other questions:
  • Make a java program to enter a two-digit integer and determine if both digits are prime
    6·1 answer
  • ________ is the amount of data that can be transmitted across a transmission medium in a certain amount of time.
    15·1 answer
  • The sequence of folders to a file or folder is called a(n) ________
    8·1 answer
  • Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. T
    9·1 answer
  • Please can someone help me with this?
    6·1 answer
  • What is the value of the variable result after these lines of code are executed?
    11·1 answer
  • HELP
    11·1 answer
  • Subscribe to Markiplier
    15·2 answers
  • Which of these are the two main components of a CPU?
    5·2 answers
  • When you are typing data that is in a series, such as days of the week or months of the year, you can use this tool to complete
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!