標籤:python 正序 反序 相同 直接上代碼#coding:utf-8def f1(x):#定義一個函數,尋找正序反序都相等的數字if type(x) !=int:#如果函數參數不是整型,退出程式exit(‘must a int type‘)x=str(x)lix=list(x)str1=‘‘i=len(lix)-1while i <len(lix)
英文文檔:input([prompt])If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read,
Python內建函數(37)——len,python內建37len英文文檔:len(s)Return the length (the number of items) of an object. The argument may be a sequence (such as a string, bytes, tuple, list, or range) or a collection (such as a dictionary, set, or frozen set).說明: 1.
Python內建函數(36)——iter,python內建36iter英文文檔:iter(object[, sentinel]) Return an iterator object. The first argument is interpreted very differently depending on the presence of the second argument. Without a second argument, object must be a collection