如何将下面的if else语句变成一行代码?
uly = '50'
if '-' in uly:
uly = uly.replace('-','S')
else:
uly = 'N'+uly
print uly
我的试用:
uly = [uly=uly.replace('-','S') if '-' in uly else uly = 'N'+uly]
print uly