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

 

posted @ 2020-05-02 18:42  profesor  阅读(134)  评论(0编辑  收藏  举报