diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2024-01-31 13:06:15 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-31 13:06:15 +0000 |
| commit | 55aef4c9aa7a10f9e271813424a4a0c4ba53301d (patch) | |
| tree | ba534db7e31fe4f752d672048369fe8bffd36f59 /challenge-254/luca-ferrari/python/ch-1.python | |
| parent | 45be1794376135a6b801530cebd2a29b04ca715d (diff) | |
| parent | 7c3628d24263d828b990af5eeac286e3ab7819af (diff) | |
| download | perlweeklychallenge-club-55aef4c9aa7a10f9e271813424a4a0c4ba53301d.tar.gz perlweeklychallenge-club-55aef4c9aa7a10f9e271813424a4a0c4ba53301d.tar.bz2 perlweeklychallenge-club-55aef4c9aa7a10f9e271813424a4a0c4ba53301d.zip | |
Merge pull request #9483 from fluca1978/PWC254
PWC 254
Diffstat (limited to 'challenge-254/luca-ferrari/python/ch-1.python')
| -rw-r--r-- | challenge-254/luca-ferrari/python/ch-1.python | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/challenge-254/luca-ferrari/python/ch-1.python b/challenge-254/luca-ferrari/python/ch-1.python new file mode 100644 index 0000000000..a0533551d8 --- /dev/null +++ b/challenge-254/luca-ferrari/python/ch-1.python @@ -0,0 +1,26 @@ +#!python + +# +# Perl Weekly Challenge 254 +# Task 1 +# +# See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-254> +# + +import sys +import math + +# task implementation +# the return value will be printed +def task_1( args ): + num = int( args[ 0 ] ) + for i in range( 2, int( math.sqrt( num ) ) ): + if ( i ** 3 ) == num: + return True + + return False + + +# invoke the main without the command itself +if __name__ == '__main__': + print( task_1( sys.argv[ 1: ] ) ) |
