check if a number is perfect cube in python

Do you want to know the details about “check if a number is perfect cube in python”. If yes, you’re in the correct article.

check if a number is perfect cube in python

x = int(input())
print(int(round(x ** (1. / 3))) ** 3 == x)

Final Words

I hope this post helps you to know about “check if a number is perfect cube in python”. If you have any doubts regarding this article please let us know via the comment section. Share this article with your friends and family via social networks.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coder Diksha. Here, I post about programming to help developers.

Share on:

Leave a Comment