首页 > 代码库 > python变量字符拼接

python变量字符拼接

cpu = instances[‘vcpus_current‘]
cpu1 = str(cpu) + ‘核‘
memory = instances[‘memory_current‘] / 1024
memory1=str(memory) + ‘G‘
info = str(cpu1) + str(memory1)
print instance_id,cpu1,memory1,info

 

i-6gdkkemx 2核 2G 2核2G

python变量字符拼接