Skip to content

Instantly share code, notes, and snippets.

@betaprojects
Last active July 15, 2021 09:45
Show Gist options
  • Save betaprojects/d8a5e52ce73b2e1a17f770df14e52a67 to your computer and use it in GitHub Desktop.
Save betaprojects/d8a5e52ce73b2e1a17f770df14e52a67 to your computer and use it in GitHub Desktop.
Project Euler & HackerRank problem 63 solution: Find how many n-digit positive integers exist which are also an nth power - solved using Python
k = int(input())
for n in range(1,10):
if len(str(pow(n,k)))==k: print (pow(n,k))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment