s= input("enter the string to be checked")
def pig(s):
first=s[0]
if first in "aeoui":
fi=s + "ay"
else:
fi=s[1:]+first+"ay"
return fi
返回fi
s= input("enter the string to be checked")
def pig(s):
first=s[0]
if first in "aeoui": fi=s + "ay"
else: fi=s[1:]+first+"ay"
return fi
fi = pig(s)
print(fi)
或 使fi
成为可从任何地方访问的全局变量
s= input("enter the string to be checked")
def pig(s):
global fi
first=s[0]
if first in "aeoui": fi=s + "ay"
else: fi=s[1:]+first+"ay"
pig(s)
print(fi)