Python 串联初级

Python 串联初级,python,Python,问题: 给出第一个专有名词:牛奶 给出第二个专有名词:float 这些词合在一起构成:牛奶面包 noun1 = input("Give the first proper noun: ") noun2 = input("Give the second proper noun: ") print("The words together form: "='noun1'+'noun2') “='noun1'+'noun2'这不起作用。有人能帮忙吗 提前感谢。如果您想连接名词,这应该可以 noun1

问题:

给出第一个专有名词:牛奶

给出第二个专有名词:float

这些词合在一起构成:牛奶面包

noun1 = input("Give the first proper noun: ")
noun2 = input("Give the second proper noun: ")
print("The words together form: "='noun1'+'noun2') 
“='noun1'+'noun2'这不起作用。有人能帮忙吗


提前感谢。

如果您想连接名词,这应该可以

noun1 = input("Give the first proper noun: ")
noun2 = input("Give the second proper noun: ")
print("The words together form: = "+noun1+noun2)
这里的noun1和noun2是变量,然后用“”引号进行打印。它们应该不带引号。请在下面第三行中查找

print("The words together form: "+noun1+noun2)

尝试
print(f“单词组合形式:{noun1}{noun2}”)
print(“单词组合形式:=”+noun1+noun2)欢迎来到Stackoverflow!请记住,这不是为了解决你的作业。你必须至少重新组织你的问题,使它看起来像是在问疑问。print(“单词组合形式:“+noun1+noun2”)
print("The words together form: "+noun1+noun2)