python print 输出

关于print输出字符串,变量,数字;

ip1 = input("ip1=?")
if ip1 == 1:
    print(ip1)
#输出 1
elif ip1 == 2:
    print('ip1= '+ bytes(2)) 
#输出 IP1= 2;由于是数字,采用bytes();
else:
    print("not in list")
#输出 not in list

猜你喜欢

转载自www.cnblogs.com/fixline/p/9829747.html