我希望同一打印语句在单独的语句中为我提供这些变量:
x = 22.4
y = 23.4
print(y,\n x)
但是Python似乎并不认为这很明显。
我尝试了r/n
,也尝试使用单独的打印语句打印出变量,但这不是我想要的。
答案 0 :(得分:-1)
try{
var pipee = new NamedPipeClientStream("../../../../../../PIPE/myfifo1");
pipee.Connect();
StreamReader reader = new StreamReader(pipee);
Debug.Log("AYEMAN"+reader.ReadLine());
}
catch(IOException e){
Debug.Log(e.Message);
}
这会很好
https://www.geeksforgeeks.org/formatted-string-literals-f-strings-python/
此链接将说明我们如何使用f-字符串
答案 1 :(得分:-1)
我建议您使用:
print("{}\n{}".format(x,y))