- Runtime exceptions occur during execution of the program and they exit abruptly in between. Compile time exceptions are those that are found before program executions start.
- A regular expression, regex, or regexp is a sequence of characters that define a search pattern. Usually this pattern is used by string searching algorithms for find or find and replace operations on strings, or for input validation.
- Here's a description of the Linux commands:
- head: used to see the first N number of lines of plain files.
- tail: used to see the last N number of lines of plain files.
- cat: used to see the content of plain files.
- awk: AWK is a programming language designed for text processing and typically used as a data extraction and reporting tool. It is a standard feature of most Unix-like operating systems.
- Following is the answer:
def append(source, destination):
with open(source, "a") as fw, open(destination,"r") as fr:
fw.writelines(fr)
append(source_file_name1, file_name2)
- Following is the answer:
filename=input("Enter file name: ")
for line in reversed(list(open(filename))):
print(line.rstrip())
- The output for the expressions are as follows:
- C@ke
- Cooookie
- <h1>