答案:

a=input()
print(a.strip())

扩展:

python中去掉空格的方法有以下几种

1.使用lstrip()函数去掉左边空格

2.使用rstrip()函数去掉右边空格

3.使用strip()函数去掉左右两边空格

4.使用replace()函数去掉所有空格

a = " * it is blank space test * "
    print (a.lstrip())
    print(a.rstrip())
    print(a.strip())
    a_new = a.replace(" ", "")
    print (a_new)