/tests2

Online Generic Tests

Write a program to compress the string?

Input Format

A single line of input consisting of the string .

Output Format

A single line of output consisting of the modified string.

Examples-Input

abbbccddaaab

Sample Output

a1b3c2d2a3b1

Explanation:

a is repeated 1 time so 'a1' followed by b which is repeated 3 times so 'a1b3' etc

def compress(input_str):
         

   return compressed_output_str 

Write a program to generate fibonacci series using recurssion ( No Use of Loops)

Fab Series = 1, 1, 2, 3, 5, 8, 13 ....

def fab(length):
    return series

Example-input
fab(4)
Example-output
[1,1,2,3]

Example-input
fab(6)
Example-output
[1,1,2,3,5,8]

Write a program file "tail.py" which works for these scenarios

tail.py -5 file1.txt  - should give the last 5 lines of the file file1.txt

tail.py -3 file3.txt  - should give last 3 lines of file file3.txt

tail.py 3 file.txt  - should give first 3 lines of file.txt

tail.py -10 file1.txt -20 file2.txt - should give last 10 lines of file1.txt and last 20 lines of file file2.txt

tail.py file.text - Full content of the file

What is de-normalisation in Database, and when & why would you use it ?

This is subjective question, no coding required