Skip to main content

Posts

Welcome to  Git: Commit Amend - Basic (Java) . This question is used to evaluate your skills on creating a new branch and pushing it to remote in Git. For this, you will be evaluated based on the following operations. The remote repository has been pre-configured into your local git repository. Your local git repository will be  linkedlist_java . Push the master branch of local git repository to the remote repository. Create a new branch with the name  new_branch . Make a change to the Java program file (do not remove it), make a commit and push the branch. Amend the commit to change the commit message. Optionally, you can push it to remote. Note 1:  Do not miss out to run  Project -> Install . Note 2:  The branch names must not be mis-spelt. Note 3:  The IDE's Git will not work in the local repository. Use Terminal for it. ---------------------------------------------------------------------------------------------------...

HackerRank Question and Answer : Hands-on - List Operations

Basic List Operations   Write the function definition for the function ' List_Op ' which takes 2 parameters ' Mylist ' and ' Mylist2 ' both of which are LIST of INTEGERS   Do as per the following to get the expected output: 1.Print ' Mylist ' 2.Print the 1st element of  ' Mylist ' 3.Print the Last  element of  ' Mylist ' 4.Add '3' as the Last element of ' Mylist ' 5.Change the 4th element of ' Mylist ' into '60' 6.Print ' Mylist ' again 7.Print from the ' 2nd ' element to the ' 5th ' element of ' Mylist ' 8.Append ' Mylist2 ' to ' Mylist ' 9.Print ' Mylist ' again 10.Extend ' Mylist ' using ' Mylist2 ' 11.Print ' Mylist ' again 12.Remove the Last element of ' Mylist ' 13.Print ' Mylist ' again 14.Print ' Length ' of ' Mylist '   Input Format for Custom Tes...

Hands-on - String Operations Part 2

Python - String Operations 2   Rajesh is trying to write a program that will evaluate and correct his resume.   Define a function called ` resume ` which takes eight parameters . All the  parameters are string .     The first parameter first is the first name. the second parameter  second is the second name the third parameter  parent is the name of the father or mother the fourth parameter  city is the name of the city the fifth parameter contains phone number in the format of string the sixth and seventh parameter contains a single string the eigth parameter contains string sentence.   The function definition code stub is given in the editor. Generate print statements   based on conditions given below:   Remove the spaces from both the end for the strings (first, second, parent, city) Capitalize the first word for the strings (first, second, parent) print the stri...

Hakcer Rank question and answer : Hands-on - Newline & Tab spacing

Newline and Tab Spacing & Raw String   Write the function definition for the function ' Escape ', which takes 3 parameters s1, s2, s3,  all of which are STRING variables.   Assign "Python\tRaw\nString\tConcept" to a STRING Variable ' s '.   The expected output is as follows: 1. Print these 3 strings separated by a New Line 2. Print these 3 strings separated by a Tab Space 3. Print ' s ' 4. Print the Raw String of ' s '    Input Format for Custom Testing # In the first line, value for 's1' # In the second line, value for 's2' # In the third line, value for 's3'   Sample Test Case 1   Sample Input STDIN      Function parameter -----       ------------------ Bahubali → s1 is a → s2 Legend → s3   Sample Output Bahubali is a Legend Bahubali    is a    Legend Python    Raw String ...

Python Hacker Rank question and answer -- String 01

Python - String Operations - 1   Define a function `stringoperation` that takes four parameters, namely 'fn', 'ln', 'para' as a string, and 'number' as an integer.   The function definition code stub is given in the editor. Generate the print statements based on the condition given as follows: First print: concat 'fn', 'number' times the number of newline character and 'ln' Second print: 'concat' 'fn' , tab space and 'ln' Third print: Prints the 'number' multiples of the string 'fn' Fourth print: Prints the 'para' string using f-string as follows: The sentence is {para}   Input Format for Custom Testing   The input from stdin will be processed as follows and passed to the function:   The first line contains a string 'fn' , the first name. The second line contains a string 'ln' , the last name. The third line contain...
Math Operations - Float   Rakul started learning Python3 to participate in the upcoming " CodeChamp " which is an University level coding competition which can provide some special privileges in the recruitment drives for the next 2 years only for those who make it to the " Top-100 ".His enthusiasm started falling when he find it difficult to understand the Mathematical operations involving " FLOAT ".Help him to understand that easily.   Write the function definition for the function " Float_fun " which takes three parameters - ' f1' which is a FLOAT Variable - ' f2'  which is also a FLOAT Variable & - ' Power ' is an INTEGER   Do the following and Print the Output as per the Sample Test Case : 1.Print "#Add" 2.Add 'f1' and 'f2' and Print it 3.Print "Subtract" 4.Subtract 'f2' from 'f1' and Print it 5.Print "Multiply" 6.Mult...

HackerRank Hands-on - Using float

Python - Using Float 1   Sanjay is trying to help vijay to find the Area of a Triangle. But for some reason he is trying to find some relation between area and pi. let's help him find that based on the condition below. Function `triangle` takes three parameters called `n1`,'n2' as float and 'n3' as integer. Formula for Area:(n1*n2) /2 Return both values Area and Pi rounded off to 'n3' decimal places. NOTE: You can get the value of pi from math module.   Input Format for Custom Testing:   Input from stdin will be processed as follows and passed to the function.   The first line contains an float  n1 , the Height of the triangle. The second line contains an float  n2 , the base of the triangle. The third line contains an integer 'n3' which specifies the number of decimal places to be rounded off.   Sample Case 0 Sample Input STDIN      Function -----     ...