#!/usr/bin/python3 print("hello, world!") name = 'Jerry' print(f"Hello, {name}, welcome back.") sum = 0 for i in range(1, 101): sum += i print(f"sum = {sum}")
或者把
print("hello, world!") name = 'Jerry' print(f"Hello, {name}, welcome back.") sum = 0 for i in range(1, 101): sum += i print(f"sum = {sum}")
保存到hello.py中,shell scripts就变成这样:
#!/usr/bin/python3 hello.py