#!/usr/local/bin/python
# -*- coding: utf-8 -*-.
# line of utf-8 is for multi-language
# optional 4-spaces before line rule for Python.
import sys
sys.path.append("/homes/sli/pexpect-2.3/")
import pexpect
import time
import re
import os
print "Welcome to Python!"
def sum(x,y):
sum = x+ y
total = ‘the sum of {} and {} is {}.‘ .format(x,y,sum)
print total
sum(2,3)
sum(-99,200)
[tool01 ~/my-test]$ ./sum-1.py
Welcome to Python!
the sum of 2 and 3 is 5.
the sum of -99 and 200 is 101.
[tool01 ~/my-test]$
时间: 2024-10-10 14:37:11