【发布时间】:2022-01-05 11:15:25
【问题描述】:
所以我必须在假设分级器定义以下变量的同时编写代码
a to be some int
b to be some float
s to be some string
然后我必须编写一个程序,打印出以下内容,其中 中的值被变量内的实际值替换。但是,您只能使用 ONE print 语句。
// The variable 'a' has value of <a>. //
\\ While the variable 'b' has value of <b>. \\
// Lastly, the variable 's' has value of "<s>". //
例如,如果 a=1、b=1.5 和 s='hi',那么预期的输出是:
// The variable 'a' has value of 1. //
\\ While the variable 'b' has value of 1.5. \\
// Lastly, the variable 's' has value of "hi". //
这是我到目前为止所拥有的,这显然不起作用......
a = int
b = folat
s = str
print(f"// The variable 'a' has value of <{a}> . //\n \\ While the variable 'b' has value of <{b}> . \\ \\n// Lastly, the variable 's' has value of <{s}>. //")
我应该做些什么改变??
【问题讨论】:
标签: python list printing tuples