你能给我解释一下你是怎么工作的吗

2024-04-25 14:42:28 发布

您现在位置:Python中文网/ 问答频道 /正文

你如何使用函数,因为我现在很困惑,真的想学习如何编码


Tags: 函数编码
1条回答
网友
1楼 · 发布于 2024-04-25 14:42:28

虽然这是明显的重复,给你。你知道吗

def function1(): # declares function 2 as printing hello
    print("hello")

def function2(): # declares function 2 as printing bye
    print("bye")

def function3(): # declares function 3 as returning "Hi again", which is printed upon it being called.
    return "Hi again"

function1() # will print hello
function2() # will print bye

print(function3()) # will return the value "Hi again" and then print it

希望这能为你澄清一切!你知道吗

相关问题 更多 >