0% found this document useful (1 vote)
1K views

HackerRank Python Practice Topics

This document contains descriptions of 154 Python programming challenges of varying difficulties from several domains. The challenges cover topics like basic programs, arrays, lists, strings, dictionaries, tuples, searching and sorting, pattern printing, date-time programs, and more. Example problems include adding two numbers, finding the factorial of a number, checking if a number is prime, Fibonacci sequences, string operations, list operations, array rotations, date-time programs, and regex parsing. Scores and success rates are provided for each challenge.

Uploaded by

03sri03
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
1K views

HackerRank Python Practice Topics

This document contains descriptions of 154 Python programming challenges of varying difficulties from several domains. The challenges cover topics like basic programs, arrays, lists, strings, dictionaries, tuples, searching and sorting, pattern printing, date-time programs, and more. Example problems include adding two numbers, finding the factorial of a number, checking if a number is prime, Fibonacci sequences, string operations, list operations, array rotations, date-time programs, and regex parsing. Scores and success rates are provided for each challenge.

Uploaded by

03sri03
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Say "Hello, World!

" With Python


EasyMax Score: 5Success Rate: 97.48%
Get started with Python by printing to stdout.

Python If-Else
EasyMax Score: 10Success Rate: 91.08%

Arithmetic Operators
EasyMax Score: 10Success Rate: 98.56%

Python: Division
EasyMax Score: 10Success Rate: 98.81%

Loops
EasyMax Score: 10Success Rate: 98.43%

Write a function
MediumMax Score: 10Success Rate: 90.18%

Print Function
EasyMax Score: 20Success Rate: 96.03%

List Comprehensions
EasyMax Score: 10Success Rate: 98.26%

Find the Runner-Up Score!


EasyMax Score: 10Success Rate: 93.49%

Nested Lists
EasyMax Score: 10Success Rate: 89.76%

Finding the percentage


EasyMax Score: 10Success Rate: 97.07%

Lists
EasyMax Score: 10Success Rate: 89.40%

Tuples
EasyMax Score: 10Success Rate: 98.24%

sWAP cASE
EasyMax Score: 10Success Rate: 98.46%

String Split and Join


EasyMax Score: 10Success Rate: 98.75%

What's Your Name?


EasyMax Score: 10Success Rate: 97.81%
Mutations
EasyMax Score: 10Success Rate: 98.33%

Find a string
EasyMax Score: 10Success Rate: 93.07%

String Validators
EasyMax Score: 10Success Rate: 93.21%

Text Alignment
EasyMax Score: 10Success Rate: 97.68%

Text Wrap
EasyMax Score: 10Success Rate: 98.66%

Designer Door Mat


EasyMax Score: 10Success Rate: 98.18%

String Formatting
EasyMax Score: 10Success Rate: 90.11%

Alphabet Rangoli
EasyMax Score: 20Success Rate: 96.70%

Capitalize!
EasyMax Score: 20Success Rate: 81.27%

The Minion Game


MediumMax Score: 40Success Rate: 84.52%

Merge the Tools!


MediumMax Score: 40Success Rate: 91.80%

itertools.product()
EasyMax Score: 10Success Rate: 98.10%

collections.Counter()
EasyMax Score: 10Success Rate: 98.33%

itertools.permutations()
EasyMax Score: 10Success Rate: 97.97%

Polar Coordinates
EasyMax Score: 10Success Rate: 94.75%

Introduction to Sets
EasyMax Score: 10Success Rate: 98.34%
DefaultDict Tutorial
EasyMax Score: 20Success Rate: 92.07%

Calendar Module
EasyMax Score: 10Success Rate: 96.96%

Exceptions
EasyMax Score: 10Success Rate: 96.18%

Collections.namedtuple()
EasyMax Score: 20Success Rate: 98.02%

Time Delta
MediumMax Score: 30Success Rate: 90.61%

Find Angle MBC


MediumMax Score: 10Success Rate: 87.12%

No Idea!
MediumMax Score: 50Success Rate: 85.47%

Collections.OrderedDict()
EasyMax Score: 20Success Rate: 98.64%

Symmetric Difference
EasyMax Score: 10Success Rate: 97.95%

itertools.combinations()
EasyMax Score: 10Success Rate: 97.38%

Incorrect Regex
EasyMax Score: 20Success Rate: 97.69%

Set .add()
EasyMax Score: 10Success Rate: 99.21%

itertools.combinations_with_replacement()
EasyMax Score: 10Success Rate: 98.81%

Word Order
MediumMax Score: 50Success Rate: 87.24%

Set .discard(), .remove() & .pop()


EasyMax Score: 10Success Rate: 96.52%

Collections.deque()
EasyMax Score: 20Success Rate: 98.25%

Compress the String!


MediumMax Score: 20Success Rate: 97.40%

Company Logo
MediumMax Score: 30Success Rate: 87.86%

Set .union() Operation


EasyMax Score: 10Success Rate: 99.20%

Piling Up!
MediumMax Score: 50Success Rate: 88.69%

Triangle Quest 2
MediumMax Score: 20Success Rate: 95.13%

Iterables and Iterators


MediumMax Score: 40Success Rate: 96.18%

Set .intersection() Operation


EasyMax Score: 10Success Rate: 99.49%

Mod Divmod
EasyMax Score: 10Success Rate: 98.93%

Power - Mod Power


EasyMax Score: 10Success Rate: 99.29%

Maximize It!
HardMax Score: 50Success Rate: 79.45%

Set .difference() Operation


EasyMax Score: 10Success Rate: 99.39%

Integers Come In All Sizes


EasyMax Score: 10Success Rate: 99.36%

Set .symmetric_difference() Operation


EasyMax Score: 10Success Rate: 99.56%

Set Mutations
EasyMax Score: 10Success Rate: 98.41%

Triangle Quest
MediumMax Score: 20Success Rate: 92.33%

The Captain's Room


EasyMax Score: 10Success Rate: 89.79%

Check Subset
EasyMax Score: 10Success Rate: 98.57%
Check Strict Superset
EasyMax Score: 10Success Rate: 95.02%

Classes: Dealing with Complex Numbers


MediumMax Score: 20Success Rate: 90.59%

Class 2 - Find the Torsional Angle


EasyMax Score: 20Success Rate: 96.71%

Zipped!
EasyMax Score: 10Success Rate: 97.77%

Input()
EasyMax Score: 20Success Rate: 95.10%

Python Evaluation
EasyMax Score: 20Success Rate: 97.06%

Athlete Sort
MediumMax Score: 30Success Rate: 95.51%

Any or All
EasyMax Score: 20Success Rate: 94.07%

ginortS
MediumMax Score: 40Success Rate: 96.72%

Detect Floating Point Number


EasyMax Score: 20Success Rate: 91.84%

Map and Lambda Function


EasyMax Score: 20Success Rate: 94.30%

Re.split()
EasyMax Score: 20Success Rate: 94.83%

Validating Email Addresses With a Filter


MediumMax Score: 20Success Rate: 88.15%

Group(), Groups() & Groupdict()


EasyMax Score: 20Success Rate: 92.40%

Reduce Function
MediumMax Score: 30Success Rate: 98.51%

Re.findall() & Re.finditer()


EasyMax Score: 20Success Rate: 89.51%
Re.start() & Re.end()
EasyMax Score: 20Success Rate: 94.70%

Regex Substitution
MediumMax Score: 20Success Rate: 92.48%

Validating Roman Numerals


EasyMax Score: 20Success Rate: 89.50%

Validating phone numbers


EasyMax Score: 20Success Rate: 96.11%

Validating and Parsing Email Addresses


EasyMax Score: 20Success Rate: 89.70%

Hex Color Code


EasyMax Score: 30Success Rate: 96.43%

HTML Parser - Part 1


EasyMax Score: 30Success Rate: 94.62%

HTML Parser - Part 2


EasyMax Score: 30Success Rate: 98.40%

Detect HTML Tags, Attributes and Attribute Values


EasyMax Score: 30Success Rate: 97.44%

XML 1 - Find the Score


EasyMax Score: 20Success Rate: 97.34%

Validating UID
EasyMax Score: 40Success Rate: 95.37%

Validating Credit Card Numbers


MediumMax Score: 40Success Rate: 94.63%

XML2 - Find the Maximum Depth


EasyMax Score: 20Success Rate: 96.75%

Standardize Mobile Number Using Decorators


EasyMax Score: 30Success Rate: 97.75%

Validating Postal Codes


HardMax Score: 80Success Rate: 85.38%

Decorators 2 - Name Directory


EasyMax Score: 30Success Rate: 89.87%

Matrix Script
HardMax Score: 100Success Rate: 87.19%

Words Score
MediumMax Score: 10Success Rate: 95.52%

Arrays
EasyMax Score: 20Success Rate: 96.05%

Shape and Reshape


EasyMax Score: 20Success Rate: 95.55%

Default Arguments
MediumMax Score: 30Success Rate: 78.98%

Transpose and Flatten


EasyMax Score: 20Success Rate: 96.64%

Concatenate
EasyMax Score: 20Success Rate: 98.87%

Zeros and Ones


EasyMax Score: 20Success Rate: 94.20%

Eye and Identity


EasyMax Score: 20Success Rate: 92.73%

Array Mathematics
EasyMax Score: 20Success Rate: 94.46%

Floor, Ceil and Rint


EasyMax Score: 20Success Rate: 95.58%

Sum and Prod


EasyMax Score: 20Success Rate: 98.12%

Min and Max


EasyMax Score: 20Success Rate: 98.42%

Mean, Var, and Std


EasyMax Score: 20Success Rate: 93.20%

Dot and Cross


EasyMax Score: 20Success Rate: 98.69%

Inner and Outer


EasyMax Score: 20Success Rate: 98.24%

Polynomials
EasyMax Score: 20Success Rate: 98.89%

Linear Algebra
EasyMax Score: 20Success Rate: 93.62%

SUBDOMAINS

Introduction

Basic Data Types

Strings

Sets

Math

Itertools

Collections

Date and Time

Errors and Exceptions

Classes

Built-Ins

Python Functionals

Regex and Parsing

XML

Closures and Decorators

Numpy

Debugging
Python Programming Examples
 
Following Python section contains a wide collection of Python programming
examples. The examples are categorized based on the topics including List, strings,
dictionary, tuple, sets and many more. Each program example contains multiple
approaches to solve the problem.
Recent Articles on Python !
Python Output & Multiple Choice Questions
 
Topics :
 Basic Programs
 Array Programs
 List Programs
 String Programs
 Dictionary Programs
 Tuple Programs
 Searching and Sorting Programs
 Pattern Printing
 Date-Time Programs
 More Python Programs

Basic Programs:
1. Python program to add two numbers
2. Python Program for factorial of a number
3. Python Program for simple interest
4. Python Program for compound interest
5. Python Program to check Armstrong Number
6. Python Program for Program to find area of a circle
7. Python program to print all Prime numbers in an Interval
8. Python program to check whether a number is Prime or not
9. Python Program for n-th Fibonacci number
10. Python Program for Fibonacci numbers
11. Python Program for How to check if a given number is Fibonacci number?
12. Python Program for n\’th multiple of a number in Fibonacci Series
13. Program to print ASCII Value of a character
14. Python Program for Sum of squares of first n natural numbers
15. Python Program for cube sum of first n natural numbers
Array Programs:
1. Python Program to find sum of array
2. Python Program to find largest element in an array
3. Python Program for array rotation
4. Python Program for Reversal algorithm for array rotation
5. Python Program to Split the array and add the first part to the end
6. Python Program for Find reminder of array multiplication divided by n
7. Reconstruct the array by replacing arr[i] with (arr[i-1]+1) % M
8. Python Program to check if given array is Monotonic
List Programs:
1. Python program to interchange first and last elements in a list
2. Python program to swap two elements in a list
3. Python program to remove Nth occurrence of the given word
4. Python | Ways to find length of list
5. Python | Ways to check if element exists in list
6. Different ways to clear a list in Python
7. Python | Reversing a List
8. Python | Cloning or Copying a list
9. Python | Count occurrences of an element in a list
10. Python program to find sum of elements in list
11. Python | Multiply all numbers in the list
12. Python program to find smallest number in a list
13. Python program to find largest number in a list
14. Python program to find second largest number in a list
15. Python program to find N largest elements from a list
16. Python program to print even numbers in a list
17. Python program to print odd numbers in a List
18. Python program to print all even numbers in a range
19. Python program to print all odd numbers in a range
20. Python program to count Even and Odd numbers in a List
21. Python program to print positive numbers in a list
22. Python program to print negative numbers in a list
23. Python program to print all positive numbers in a range
24. Python program to print all negative numbers in a range
25. Python program to count positive and negative numbers in a list
26. Remove multiple elements from a list in Python
27. Python | Remove empty tuples from a list
28. Python | Program to print duplicates from a list of integers
29. Python program to find Cumulative sum of a list
30. Break a list into chunks of size N in Python
31. Python | Sort the values of first list using second list
More >>
String Programs:
1. Python program to check if a string is palindrome or not
2. Reverse words in a given String in Python
3. Ways to remove i’th character from string in Python
4. Python | Check if a Substring is Present in a Given String
5. Find length of a string in python (4 ways)
6. Python program to print even length words in a string
7. Python | Program to accept the strings which contains all vowels
8. Python | Count the Number of matching characters in a pair of string
9. Python program to count number of vowels using sets in given string
10. Remove all duplicates from a given string in Python
11. Python | Program to check if a string contains any special character
12. Generating random strings until a given string is generated
13. Find words which are greater than given length k
14. Python program for removing i-th character from a string
15. Python program to split and join a string
16. Python | Check if a given string is binary string or not
17. Python | Find all close matches of input string from a list
18. Python program to find uncommon words from two Strings
19. Python | Swap commas and dots in a String
20. Python | Permutation of a given string using inbuilt function
21. Python | Check for URL in a String
22. Execute a String of Code in Python
23. String slicing in Python to rotate a string
24. String slicing in Python to check if a string can become empty by recursive deletion
25. Python Counter| Find all duplicate characters in string
More >>
Dictionary Programs:
1. Python | Sort Python Dictionaries by Key or Value
2. Handling missing keys in Python dictionaries
3. Python dictionary with keys having multiple inputs
4. Python program to find the sum of all items in a dictionary
5. Python | Ways to remove a key from dictionary
6. Ways to sort list of dictionaries by values in Python – Using itemgetter
7. Ways to sort list of dictionaries by values in Python – Using lambda function
8. Python | Merging two Dictionaries
9. Program to create grade calculator in Python
10. Python | Check order of character in string using OrderedDict( )
11. Python | Find common elements in three sorted arrays by dictionary intersection
12. Dictionary and counter in Python to find winner of election
13. Find all duplicate characters in string
14. Print anagrams together in Python using List and Dictionary
15. K’th Non-repeating Character in Python using List Comprehension and OrderedDict
16. Check if binary representations of two numbers are anagram
17. Python Counter to find the size of largest subset of anagram words
18. Python | Remove all duplicates words from a given sentence
19. Python Dictionary to find mirror characters in a string
20. Counting the frequencies in a list using dictionary in Python
21. Python | Convert a list of Tuples into Dictionary
22. Python counter and dictionary intersection example (Make a string using deletion and
rearrangement)
23. Python dictionary, set and counter to check if frequencies can become same
24. Scraping And Finding Ordered Words In A Dictionary using Python
25. Possible Words using given characters in Python
More >>Tuple Programs:
1. Create a list of tuples from given list having number and its cube in each tuple
2. Sort a list of tuples by second Item
Searching and Sorting Programs:
1. Python Program for Binary Search (Recursive and Iterative)
2. Python Program for Linear Search
3. Python Program for Insertion Sort
4. Python Program for Recursive Insertion Sort
5. Python Program for QuickSort
6. Python Program for Iterative Quick Sort
7. Python Program for Selection Sort
8. Python Program for Bubble Sort
9. Python Program for Merge Sort
10. Python Program for Iterative Merge Sort
11. Python Program for Heap Sort
12. Python Program for Counting Sort
13. Python Program for ShellSort
14. Python Program for Topological Sorting
15. Python Program for Radix Sort
16. Python Program for Binary Insertion Sort
17. Python Program for Bitonic Sort
18. Python Program for Comb Sort
19. Python Program for Pigeonhole Sort
20. Python Program for Cocktail Sort
21. Python Program for Gnome Sort
22. Python Program for Odd-Even Sort / Brick Sort
23. Python Program for BogoSort or Permutation Sort
24. Python Program for Cycle Sort
25. Python Program for Stooge Sort
Pattern Printing Programs:
1. Program to print the pattern ‘G’
2. Python | Print an Inverted Star Pattern
3. Python 3 | Program to print double sided stair-case pattern
4. Print with your own font using Python !!
Date-Time Programs:
1. Python program to convert time from 12 hour to 24 hour format
More Python Programs:
1. Python Program to Reverse a linked list
2. Python Program for Find largest prime factor of a number
3. Python Program for Efficient program to print all prime factors of a given number
4. Python Program for Product of unique prime factors of a number
5. Python Program for Find sum of odd factors of a number
6. Python Program for Coin Change
7. Python Program for Tower of Hanoi
8. Python Program for Sieve of Eratosthenes
9. Python Program to Check if binary representation is palindrome
10. Python Program for Basic Euclidean algorithms
11. Python Program for Extended Euclidean algorithms
12. Python Program for Number of elements with odd factors in given range
13. Python Program for Common Divisors of Two Numbers
14. Python Program for Maximum height when coins are arranged in a triangle
15. Python Program for GCD of more than two (or array) numbers
16. Python Program for Check if count of divisors is even or odd
17. Python Program for Find minimum sum of factors of number
18. Python Program for Difference between sums of odd and even digits
19. Python Program for Program to Print Matrix in Z form
20. Python Program for Largest K digit number divisible by X
21. Python Program for Smallest K digit number divisible by X
22. Python Program for Print Number series without using any loop
23. Python Program for Number of stopping station problem
24. Python Program for Program to calculate area of a Tetrahedron
25. Python Program for focal length of a spherical mirror
26. Python Program for Find the perimeter of a cylinder
27. Check if a triangle of positive area is possible with the given angles
28. Python Program for Number of jump required of given length to reach a point of form
(d, 0) from origin in 2D plane
29. Python Program for Finding the vertex, focus and directrix of a parabola
30. Python program to find the most occurring character and its count
31. Python Program for Find sum of even factors of a number
32. Python Program for Check if all digits of a number divide it
33. Python program to convert float decimal to Octal number
34. Python program to convert floating to binary
35. Check whether a number has consecutive 0’s in the given base or not
36. Python Program for Number of solutions to Modular Equations
37. Python Program for Triangular Matchstick Number
38. Python Program for Legendre\’s Conjecture
39. Python program to check if a string contains all unique characters
40. Python program to copy odd lines of one file to other

You might also like