-1

这是我的python代码:我最后得到的唯一输出是“真” 为什么我没有收到其他人的输出?请帮忙。我在 Visual Studio 代码上使用 jupyter notebook。内核:Python 3.9 64 位

# RELATIONAL OPERATORS
num1 = 10
num2 = 0
num3 = 10
str1 = "good"
str2 = "life"

# Equals to
num1 == num2
str1 == str2

# Not equal to
num1 != num2
str1 != str2
num1 != num3

# Greater Than
num1 > num2
str1 > str2

# Less Than
num1 < num3
str2 < str1

# Greater than or equal to
num1 >= num2
num2 >= num3
str1 >= str2

#Less then or equal to
num1 <= num2
num2 <= num3
str1 <= str2

4

1 回答 1

0

您必须将每个语句包装在 print()

num1 = 10
num2 = 0
num3 = 10
str1 = "good"
str2 = "life"

print(num1 == num2)
print(str1 == str2)
# so on and so forth
于 2021-10-01T16:23:08.777 回答