aboutsummaryrefslogtreecommitdiff
path: root/challenge-287/luca-ferrari/python/ch-2.py
blob: d76523ff394f19b71c4344936a81c19effbcfdf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!python

#
# Perl Weekly Challenge 287
# Task 2
#
# See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-287>
#

import sys
import re

# task implementation
# the return value will be printed
def task_2( args ):
    number = args[ 0 ]
    good = re.compile( '^[+-]?\\d+([.]\\d+)?(E[+-]?\\d+)?$' )
    return good.match( number ) is not None

# invoke the main without the command itself
if __name__ == '__main__':
    print( task_2( sys.argv[ 1: ] ) )