startwith的使用方法(Python) 用处使用方法实例 用处 用来判断字符串是否以XX开头 使用方法 str.startswith(str, beg=0,end=len(string)); 实例 if code.startswith('Z') : print('code是以Z开头')