HackerRank Exceptions problem solution in python | python problem solution

ExceptionsErrors detected during execution are called exceptions.Examples:ZeroDivisionErrorThis error is raised when the second argument of a division or modulo operation is zero.>>> a = '1'>>> b = '0'>>> print int(a) /…

Continue ReadingHackerRank Exceptions problem solution in python | python problem solution

HackerRank DefaultDict Tutorial solution in Python | python problem solution

 The defaultdict tool is a container in the collections class of Python. It's similar to the usual dictionary (dict) container, but the only difference is that a defaultdict will have a default value if…

Continue ReadingHackerRank DefaultDict Tutorial solution in Python | python problem solution

HackerRank Introduction to Sets solution in python | python question solution

A set is an unordered collection of elements without duplicate entries.When printed, iterated or converted into a sequence, its elements will appear in an arbitrary order.Example>>> print set()set([])>>> print set('HackerRank')set(['a', 'c', 'e',…

Continue ReadingHackerRank Introduction to Sets solution in python | python question solution

HackerRank Polar Coordinates solution in python | python example solution

Polar coordinates are an alternative way of representing Cartesian coordinates or Complex Numbers.A complex number  is completely determined by its real part  and imaginary part .Here,  is the imaginary unit.A polar coordinate () is completely determined by modulus  and…

Continue ReadingHackerRank Polar Coordinates solution in python | python example solution

HackerRank itertools.permutations() solution in Python | python problem solution

itertools.permutations(iterable[, r])This tool returns successive  length permutations of elements in an iterable.If  is not specified or is None, then  defaults to the length of the iterable, and all possible full length permutations are generated.Permutations…

Continue ReadingHackerRank itertools.permutations() solution in Python | python problem solution

HackerRank collections.Counter() solution in Python | python problem solution

 collections.Counter()A counter is a container that stores elements as dictionary keys, and their counts are stored as dictionary values.Sample Code>>> from collections import Counter>>> >>> myList = [1,1,2,3,4,5,3,2,3,4,2,1,2,3]>>> print Counter(myList)Counter({2:…

Continue ReadingHackerRank collections.Counter() solution in Python | python problem solution

Java MCQ Questions and Answers on Relational Operators 1

blog.softwaretechit.comhome.softwaretechit.comStudy and learn Java MCQ questions and answers on Relational Operators or Comparison Operators. Also, learn their priorities. Attend job interviews easily with these Multiple Choice Questions.Go through Java Theory Notes…

Continue ReadingJava MCQ Questions and Answers on Relational Operators 1

HackerRank Merge the Tools! solution in python | python problem solution

 Consider the following:A string, , of length  where .An integer, , where  is a factor of .We can split  into  substrings where each subtring, , consists of a contiguous block of  characters in . Then, use each  to create string  such that:The characters…

Continue ReadingHackerRank Merge the Tools! solution in python | python problem solution

HackerRank The Minion Game solution in python | python question solution

Kevin and Stuart want to play the 'The Minion Game'.Game RulesBoth players are given the same string, .Both players have to make substrings using the letters of the string .Stuart has to…

Continue ReadingHackerRank The Minion Game solution in python | python question solution