請問python如何打印字符串+變量值。例如:the value is 100
在C語言中:
int value = 100;
printf(“the value is %d\n”,value);
輸出為 the value is 100
在python中:
value = 100
print(‘the value is’,value)
輸出為 ('the value is',100)
在C語言中:
int value = 100;
printf(“the value is %d\n”,value);
輸出為 the value is 100
在python中:
value = 100
print(‘the value is’,value)
輸出為 ('the value is',100)
2018-11-15
舉報
2019-09-24
value = 100
print("the value is %d" %value)? 中間不能加逗號
2019-05-07
value = 100
print ('the value is %d',%(value))