You are not logged in. Please login at www.codechef.com to post your questions!

×

Why I am getting Re(NZEC) in python 3.5?

enter code here
import re
l=[]
for test in range(int(input())):
 a=input()
 aa=len(a)
 if(aa%2==0):
    aaa,bbb=a.split('.')
    ccc=bbb[0]
    aaaa=aaa+ccc
    if(aaaa==bbb[::-1]):
        print(aaaa+bbb)
    else:
        print("-1")
 elif(aa%2!=0):
    aaa,bbb=a.split('.')
    if(aaa==bbb[::-1]):
        print(aaa+'a'+bbb)
    else:
        print("-1")

asked 30 Aug '17, 03:01

x299792458x's gravatar image

2★x299792458x
132
accept rate: 0%


There can be more than 1 "." in string.. so aaa,bbb=a.split('.') would give problem I guess..

link

answered 30 Aug '17, 03:27

kauts_kanu's gravatar image

5★kauts_kanu
1.1k110
accept rate: 19%

edited 30 Aug '17, 03:28

1

Yes It worked. I modified my code. Thanks

(30 Aug '17, 14:59) x299792458x2★

Please accept answer If it was helpful.. :)

(30 Aug '17, 15:16) kauts_kanu5★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×545
×529
×281

question asked: 30 Aug '17, 03:01

question was seen: 565 times

last updated: 30 Aug '17, 15:16