خرید بک لینک

Vote count: 0

I was trying to solve this problem. https://www.hackerrank.com/challenges/introduction-to-regex

The code is working absolutely fine in my PC. But hacker ranks throws error after two runs. Dont know why.. Please help

import re

n1 = int(input())
for i in (0, n1):
    n = input()
    if (re.findall(r'[a-zA-Z]',n)):
        print("False")
    elif re.match(r'+[0-9]*.[0-9]*', n):
        print ("True")
    elif re.match(r'-[0-9]*.[0-9]*', n):
        print ("True")
    elif re.match(r'[0-9]*.[0-9]*', n):
        print ("True")
    else:
        print("False")

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 26 فروردين 1395 ساعت: 12:08

صفحه بندی