妙计旅行面试题-实用的tcl脚本编程教程
二、妙计旅行面试题1. Python主要的内置数据类型有哪些?(2018-4-16-lxy) Python主要的内置数据类型有:str,int,float,tuple,list,dict,set。 2. print(dir('a'))输出的是什么?(2018-4-16-lxy)会打印出字符型的所有的内置方法。 1. ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__len__', '__lt__', '__mod__', '__mul__', '__new__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] 3.给定两个list,A和B,找出相同元素和不同元素?(2018-4-16-lxy) A、B中相同元素:print(set(A)&set(B)) A、B中不同元素:print(set(A)^set(B))
8.85MB
文件大小:
评论区