Thamizhiniyan C S
HomeWriteupsResourcesCheatsheets
HackerRank
HackerRank
  • HackerRank
  • Linux Shell
    • Bash
    • Text Processing
      • Cut
      • Head
      • Middle
      • Tail
      • Tr
      • Sort
      • Uniq
      • Paste
    • Arrays In Bash
    • Grep Sed Awk
      • Grep
      • Sed
      • Awk
  • Regex
    • Introduction
    • Character Class
    • Repetitions
    • Grouping and Capturing
    • Backreferences
    • Assertions
    • Applications
  • Python
    • 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
  • C
    • Introduction
    • Conditionals and Loops
    • Arrays and Strings
Powered by GitBook
On this page
  • Mod Divmod
  • What's divmod
  • Task
  • Solution
  • Polar Coordinates
  • What is Polar Coordinates
  • Pythons mathematical functions for complex numbers
  • Task
  • Solution
  • Power - Mod Power
  • Introduction
  • Task
  • Solution
  • Integer Come in All Sizes
  • Find Angle MBC
  • Triangle Quest
  • Triangle Quest 2

Was this helpful?

  1. Python

Math

PreviousSetsNextItertools

Last updated 1 year ago

Was this helpful?

Mod Divmod

What's divmod

Task

Solution

a = int(input())
b = int(input())

print(a // b)
print(a % b)
print(divmod(a, b))

Polar Coordinates

What is Polar Coordinates

Pythons mathematical functions for complex numbers

Task

Solution

from cmath import phase

complex_number = complex(input())

print(abs(complex_number))
print(phase(complex_number))

Power - Mod Power

Introduction

Task

Solution

a = int(input())
b = int(input())
m = int(input())

print(pow(a, b))
print(pow(a, b, m))

Integer Come in All Sizes

a = int(input())
b = int(input())
c = int(input())
d = int(input())

print(pow(a, b) + pow(c, d))

Find Angle MBC

from math import degrees, atan

AB = int(input())
BC = int(input())

print(str(round(degrees(atan(AB / BC)))) + chr(176))

Triangle Quest

for i in range(1,int(input())):
    print(((10**i-1)//9)*i)

Triangle Quest 2

for i in range(1, int(input())+1):
    print(((10 ** i)//9) ** 2)
Solve Programming Questions | HackerRankHackerRank
Logo