程式碼 print("練習函數abs, all, any, ascii") for i in range(-2,3): x = abs(i) print(abs(x)) print("all邏輯,是否全部是真?") x, y, z = 1==1, 2>1, 3>2 #=給值,==判斷 print(all([x,y,z])) print("2>1,-1==1,-2>3有正確的嗎",any([2>1, -1==1, -2>3])) print("2>1,-1==1,-2>3全正確嗎",all([2>1, -1==1, -2>3])) #pthon註解range(開始,結束) print("列印,迴圈for, range範圍") for i in range(33301, 33344): print("字碼character", i,"是",chr(i)) for i in range(65, 70): print(chr(i)) w3schools內建函數列表 https://www.w3schools.com/python/python_ml_data_distribution.asp Function Description abs() Returns the absolute value of a number all() Returns True if all items in an iterable object are true any() Returns True if any item in an iterable object is true ascii() Returns a readable version of an object. Replaces none-ascii characters with escape character bin() Returns the binary version of a number bool() Returns the boolean value of the specified...
自己做,很優。https://keiime.blogspot.com/2023/12/w3schoolscanvassvg.html
回覆刪除