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
Answer:
// here is code in java.
import java.util.*;
class Solution
{
// main method of class
public static void main (String[] args) throws java.lang.Exception
{
try{
// declare variable
double caffeine;
// scanner object to read input from user
Scanner scr=new Scanner(System.in);
System.out.print("Enter the initial amount of caffeine:");
// read the initial amount of caffeine
caffeine=scr.nextDouble();
// calculate amount of caffeine after 6,12,18 hours
for(int i=1;i<=3;i++)
{
System.out.println("After "+ i*6+" hours:"+(caffeine/2)+" mg");
// update the caffeine after every 6 hours
caffeine=caffeine/2;
}
}catch(Exception ex){
return;}
}
}
Explanation:
Create a variable "caffeine" to store the initial amount of caffeine given by user. Run a loop for three time, it will calculate the amount of caffeine left after every 6 hours.First it will give the amount of caffeine left after 6 hours, then caffeine left after 12 hours and in last caffeine after 18 hours.
Output:
Enter the initial amount of caffeine:100
After6 hours:50.0 mg
After12 hours:25.0 mg
After18 hours:12.5 mg
Hey There!
To connect an Xbox controller you click the Xbox logo on the middle of the controller, the button should turn white.
Have A Brainly Day :)
Answer:
Power down your Chromebook by doing a hard reset.
Explanation:
The first thing to check for when your Chromebook won't turn on is a dead battery. Plug the unit in via AC charger and let it charge for at least 30 min to an hour and try turning it on again.
Answer:
gives back less (or distorts) than what the client has said.
Explanation:
Emotional intelligence can be defined as the cognitive ability of an individual or person to be able to recognize his or her emotions, have an understanding of the message being conveyed and knowing how these emotions affect the people around him or her.
Basically, there are five (5) main characteristics or features of emotional intelligence and these are;
I. Motivation.
II. Self-awareness.
III. Social skills.
IV. Self-regulation.
V. Empathy.
Empathy simply means putting yourself in a person's position, depicting how you will feel if you were in his or her situation. Also, empathy depicts getting the perspective of a thing through another person's lens, eyes or ears.
There are three (3) main types of empathy and these includes;
I. Basic (interchangeable empathy).
II. Additive empathy.
III. Subtractive empathy.
In Subtractive empathy, the counselor responses gives back less (or distorts) than what the client has said.
This ultimately implies that, subtractive empathy requires the counselor using an inappropriate listening or influencing skills.