系统相关
首页 > 系统相关> > shell scripting Python

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

 

标签:shell,name,Python,sum,py,Jerry,print,hello,scripting
来源: https://www.cnblogs.com/profesor/p/12819028.html