shell scripting Python

#!/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

猜你喜欢

转载自www.cnblogs.com/profesor/p/12819028.html
今日推荐