python之列表、字典、集合
列表
name = ["Alex","Eenglan","Eric"]
print(name[0])
print(name[1])
print(name[2])
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgIAAABMCAIAAACQ6kiuAAAC10lEQVR4nO3dy3GjQBRAUbIaMpkI1OF0Ao6joyGByYJZgBEfyeVCLTeud84KYUx5xQVkeN2/lRGAYDoZAIhMBgBCkwGA0GQAIDQZAAitTgaG3Hdd13WpVPzTAHi/0xkoaX/QP64B4OrOZmDI/f7kXwYAfp+zGSipSyltDvsyAPD7nMxASV0qQ+7Xx/1DBuZvDPo8TD+dlqcFwQC4hHMZGHLf52EsaT7Gj+N4yMC8zTiWNG80ZWPIt/vvANDWuQxMZ/Td/Vx/Xrm7OFgs67fhAKC1UxlYndAvp/rPrwbGcRg2VwO9O0IAV3EmA2l/xz99zM8NbC8PPp8m6FKZt5zvJPluAOAqPEUMEJoMAIQmAwChyQBAaDIAEJoMAIQmAwChyQBAaDIAEJoMAITWMgNGVwI0dyYD63eHvnwMN6wGoKXTL5qej90lv/jeaBkAaOmVDFQ5gssAQEsvjp1ZHcEfjJxMOff7yTT720n7DGzeTv1sPwBUUutq4DhysqT5wL1sdlwYH80sO2682w8A1bz63cBYynKwfnKaf994OdN/PsF4vacv4gFAHS9mYBlHeRw5+fVFwHFX249D7mUA4P3q/cPoceTktDwvrm71f34eHo6unLbpb7e+6/7c/j7cDwCV/OTjY198JQBAGz/6FPHj038A2vFOIYDQZAAgNBkACE0GAEKTAYDQZAAgNBkACE0GAEJ7awY8KgxwdW8dQrm8eA6Ai2o+hBKAlpoPoQSgpRpDKJdXQM+vjtuuXP/edsIkAM3Vuhoo6cFbQ3eXC8soGZcRAFdRcQjltyeLAXAZtYZQficD98GSQ856AHAFNf5hdPV5P0ty90XA50ozZwAuwlPEAKHJAEBoMgAQmgwAhCYDAKHJAEBoMgAQmgwAhCYDAKHJAEBoMgAQmgwAhCYDAKHJAEBoMgAQmgwAhCYDAKHJAEBoMgAQmgwAhCYDAKHJAEBoMgAQ2n8MAFREKH2FOQAAAABJRU5ErkJggg==" alt="" />
下标
name = ["Alex","Eenglan","Eric","Rain","World","Tom"]
print(name[1:4]) #取下标1到下标4之间的数字,包括1,不包括4.顾头不顾尾。
print(name[1:-1]) #取下标1到-1的值,不包括-1
print(name[::2]) #取下标0到之后所有,每隔两个取一个
print(name[-1]) #取下标最后一个
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlkAAABbCAIAAADPzQcyAAAHiklEQVR4nO3d29WbOBQGULoKnaQCqxw1MG1EzYRiPA/GmIvAmIvtP9r7IWuc2HDAa/GNLNCprgBQturTBQDAh8lCAEq3lIUpVFVVVVUdm9urkN5V1grb6jnvKL6+nibWt+/zq75GgC+wmIUxNr1Xoe6/PMz9Ev3qFXpbPZuP4mlo/ZR6mhhlIcDAyixsYj2+st5HjYcMNV4dHmXq2fap1UfRxMvCDk+pZ3GLm+uRhQBj68eFmX/vAuzZO5/64A+wBx7FIe71NLE+5ZzIQoCx/Vl4SIx9PAu/ZzZUFgK8284snPy22M7+dbfbVFUVYqwHv/hlfpccR9HwPo+Z7RxjeBTtq5DaCoZ/2f/cWbeiPM5Ot+Hxrsb1vHR+ZCHA2LHjwm6aqrtxI4X26ty9bfof10kWZt882s5RpkeRQiZSRvvtRm0n1dPEenpyls/YyvMjCwHGjpkvvKbUJdbMgO/x5m6U04ubyRV8PDrK5sEhskcx3cVcWh/uvuX+faCZseLT/3uYIwsBxg7Jwu6ext7ti03TDN6zfLGeubI/5szWXOt3PuHXHcWaCh+VzWfLznpSGD3ZOZhBlIUAh9mehfmnEQZTW/e33H6DHE+/ta+7T2TmFOvLpa6qX5ff2e1MK3p9LnF8FL3X2QnOx46HKxHkt725ni77+mfsdjbq+Hdcz8x5zpOFAGPr1505ysKk1x7bnvA7z7fVY90ZgFkfWI80PxAEgA+xNjcApZOFAJROFgJQOlkIQOlkIQClk4UAlE4WAlC69c/af09Xo5udK5wdTj2792U1AOBD1q/BtmVF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RsML2QHKdjetaR3iAM+zJwnbiqus5e/tQvoPr43aPW3YuT9ptMx0XppDphTHXlffoAWUTY0ophBC6YWG2C+6aCu+fkoUAJ9jZ1z7bsHU0TJze0DJMz8P0dt3+Krmm3/qJz2bES0wpXi5pcnKW29Bv6Fl/IwsBttiRhb2hXe8e/7lx4fXaNINxYb1wWd/5hF9X2ZqkeYy25pNkWz29GcPHvqbjwjUVdr+pykKA423Owm7mr/vv8F+2Se9gNq77SXB5vnDLs3rjZyrmRq3Txy6GawocVc+1HZ0ObyLNzBcOdp1vdNyerRCePi4iCwFet37dmbfZ9oTfeb6tnhzrzgDsYD1SAEonCwEonSwEoHSyEIDSyUIASicLASidLASgdLIQgNLJQgBKJwsBKF0+C8drewLAvyufhTGmrlvC8+72APCTzYwL+71tUzIwBOAftjBfOGmt1+s31MS6quq6rqr6cqnf3ckCAA60PgsHfWj/tr3puz9NKgLwU63Pwu5lClX4077s/wkAP9KecaEsBOBfMJeF90bp/ZnA8XxhFULo/jRlCMAP5Vl7AEonCwEonSwEoHSyEIDSyUIASicLASidLASgdLIQgNLJQgBKJwsBKJ0sBKB0shCA0slCAEonCwEonSwEoHSyEIDSyUIASicLASidLASgdLIQgNLJQgBK9z9uOtGDASbB9wAAAABJRU5ErkJggg==" alt="" />
追加
append
name = ["Alex","Eenglan","Eric","Rain","World","Tom"]
name.append("Lilei") #追加Lilei到最后一个
print(name)
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcMAAAAkCAIAAAB60sYHAAAD8UlEQVR4nO2b0ZXbIBBF6Sp0kgpEOTSQNpZmlmLIhyQMEkhIA5Y3ufdjj60EZhjgMYxtFQAAQIZ62gEAgB8PSgoAIAUlBQCQgpICAEg5UlJnlFJKKW39/M64IT7c63mcP/f4tFHgz3ts9fLwB8bHWz0rxEdtxIc4VFJrffLO6PRtgTWwV+N63nO/Vuf8kFGcbqH/3J+M+pzO/zI/f3YdDrWezU7zCt/Mac2WtxYlbVVSb3Uxivv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CkgIASEFJAQCk/AXs4KqikOnzzwAAAABJRU5ErkJggg==" alt="" />
插入 insert
name = ["Alex","Eenglan","Eric","Rain","World","Tom"]
name.insert(2,"Lilei") #Lilei插入到下标为2的位置
print(name)
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAasAAAAkCAIAAAC44oKDAAAD3UlEQVR4nO2b25XjIBBEyWrJZCNQh9MJbBpDMkMw2g8sxFsvkHTcdT/m2FpDFw2UWtirZgAAkIp6WgAAADwGHBAAIBc4IABALnBAAIBc4IAAALm0HNCQUkoppdm6d2SGaDjX8zg953j/KN6mEHruidVLYdaPZe0c4lUb8SBNB2S2wTvS4dsCS0KO5mO7536ttnnlKKLFt1thsmRvzvPmxhOuJ6I+p+5f3PVnd0qtH8v8/Q5oWRdHn6+qozecWs+HWy0Va5eb0tOjSC9bnvIPbioMW92f51zzRs/X9TR7vEePIaX0NGmlmengQqzNqSFFPw/vlEZ0EQ5YwbJOc/jgw+kaelv57q5uZ2foVyi8nOcuLHos6xc8jzk/MMx2tsYcSk/LAfuN6yPQ9dljBiU7oCFFRNHsPL4zuwh4fBS9PjaCjnnuwtsccGI7GyIzG3NMzT0O6FQtfR7VWECwAxpSZCzr+LCpfFzqv05xr92LvuvVV/dBt4XoxKyjJ6bCU0E6ivjMt9JPt1FkVXUhV+0811r1Upglwy2E/GJBYXdR6/z5jtNQqZ6RM2iIjGWt2QQlYDg7xYx9VJWmXusBzt5aP5a1i7o8z2+d/0t1wM/RgKEwR0lm/fGBP0Z1jtk+lDlHXpvk0Q2tyzAxu7Bh9h1C4cNJP31HsXlxM8+1rnopTNKVG0mu0LvjiIyFd+KdczpmBi2zMYaIyKTrcD1M25mxpdVwB4wU/n72tP/bji7XAYPaqbrrwvoqXIsjvscNQn9q+zx6YW/4eqHu43mdUdxjvUcRDaTtgLU8j3PAtryiwsG/YknMfyMbA2eQJzaGp8lkm6Id9DaFG7F+opscHLBGUMYFa69Wm8yztVENqBtpPTflvpVXlke/thbXu/Ge1XlxFHNcuu6sAf1I9wjolec9OVxzV98xF/X4O2vxZPCEv5zTE5wE+iuFGnBPxvxTc1+F9VhrDQgH3HBAf6LnX9O/pZiK6qnoSMYX/6Z5DnjmF0yF07xidPc6PBgKWjpvLpe26nMsov5Mf4v9dBhFGDwJsYYpK0yOvrJW5Zxdz3PtSSCPvlysx7ygxzteOKduvjT/pnoqK6GHnvlTGcdfBBfOAaNUtFYdEVVn8ZzCJVrYNj0HXMJS6Xk96e1rHXBzxQ7h3O+eTtM4KrrCzaM4wdsUQs9Rnlb49f8nRAjl2y8AQABwQACAXOCAAAC5wAEBAHKBAwIA5AIHBADIBQ4IAJALHBAAIBc4IABALnBAAIBc4IAAALnAAQEAcoEDAgDkAgcEAMgFDggAkAscEAAgFzggAEAucEAAgFzggAAAufwHmLaULIQBLDkAAAAASUVORK5CYII=" alt="" />
修改
name = ["Alex","Eenglan","Eric","Rain","World","Tom"]
name[2]="Lilei" #修改下标是2的字符串为Lilei
print(name)
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZ0AAAAnCAIAAABbmwJSAAADyUlEQVR4nO2b27WkIBBFyWrIZCKwwiGBSeOSzBCM86HSyMMHYuuw9v64y/YKVRRwLMtuNQIA9IV62gEAgMagawDQG+gaAPQGugYAvYGuAUBvnNA1K0oppZQ2bvok9haX6nq+z5863j+Kt3n4Nn9a2WrlYdKPM3raka9a+O/gjK4Z44JPosOPGZawn436fs/tWu3zylGslvhhD6ON8eU4727vJ+e9HMPpP9P5Z1dmqR9nDLoWU6drzuhsjNO1e/ZmVer5dKslu2xyQ3t6FPFpZ4b0wl0Pw1a3xHmzx9TnnZ6r/LGilB4GrbQxcnLiSzG0ouTn4ZW5YR1dy1Cdr+VwRscz9eDj4cf0vueHu/o6B02/wENn9AueiKZdbo1xo7P21LRv6Vq7cc0OTn1eXpkjupalqa5ZUSKyWgOP77cmDjw+ilaX3cHbdG0wbrQidrT2nDff0bXJq6XPsz5mQNcytNQ1K0qsM3pdxMkXO/3Lh+l4Omi7K3y+H3SbsS7G6NUzVOY5IR7FumJb6KfZKJIMOBOr7TiXWrXyMA50XNGOrd8ZMStindHa2CBdC6PhnZlPhl7lQq31DXq9NV/O6Mnq8kS9V8dG1xIa6tpcArASzkQ0f75M4Iugkw5uF1/qSPO11LqVz2KPJCxsmFTcMxdH/bQdxe7J3TiXumrlYXg/OxjDeyLmjLHWiojYeN4/RSorGUEtxPCWPLRsS5u/8x7yf7eto2sZGupakOcU91KYC4Ur/o53mYHpOdtPrWd2oM81yuqc5ijZndx6FKuBbOtaKc736VoioTvWb4yYGYy1Zhhssgi3jX7Nwx1bP6tbMrpWQztdC1KuYIWX8ohxdG6Vr+mNybv4vSHvWWr92or/3MmP7IGLoxjXaebBfM2P9IgDFz3096dsxa1CNer8CSps/kwmX9ud5eVqu/FetVrydvM1dO0SrXTNV8r8sfxZEp9V7rMqvfjHge36Ws03gDJVsqz16TgsAAUtJ8XNp6FqLn+oX8PvbD8NRhEaj0x8zOQ9jEpcSat8zKrj7HUsjOEUH23+xtYLkW/hzzgnteuXoZn62ipcW7MsIsWo1Xm4WAvbxvW1xazknpij3tC1hOrfG3yNuu8NVbNRErrCl0dRwds8fJs/KU97yO8NyvD70Jj8rRsA/h/QNQDoDXQNAHoDXQOA3kDXAKA30DUA6A10DQB6A10DgN5A1wCgN9A1AOgNdA0AegNdA4DeQNcAoDfQNQDoDXQNAHoDXQOA3kDXAKA30DUA6A10DQB6A10DgN5A1wCgN9A1AOiNfxc92Oo+wY3NAAAAAElFTkSuQmCC" alt="" />
删除三种方法
name = ["Alex","Eenglan","Eric","Rain","World","Tom"]
name.remove("Tom") # 删除字符串Tom
print(name) name1 = ["Alex","Eenglan","Eric","Rain","World","Tom"]
del name1[-1] #删除下标为-1列表
print(name1) name2 = ["Alex","Eenglan","Eric","Rain","World","Tom"]
name2.pop() #删除最后一个
print(name2)
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWkAAABEC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Dsti8qb48ngQ8B7uD52CN8bPAcxDPwTvBc3C7qLfTMYsuFH81ext4Dg4CnoPtom6hYxZdGE078BwcAjwH0/OWc9dZ4DkYF4znIOA56EsHeRbFf8ZzsN1ieA7+ZPAc9B7PwZ3x4DkIEXgO1uqq9DM8B/EcBO89noN4Du6NJ2hF3GJ4Dn4xeA765qL9DKN56hHPcXivtA6/Z/Eez0GA46AdACAB7QAACWgHAEhAOwBAAtoBABLQDgCQgHYAgAQ8BzsyWhbEc7ou3g2rg+dggQ/JYvOm+vJ4EvAc7A6egzXGzwLPQTwH7wTPwe2i3k7HLLpQ/NXsbeA5OAh4DraLuoWOWXRhNO3Ac3AI8BxMz1vOXWeB52BcMJ6DgOegLx3kWRT/Gc/BdovhOfiTwXPQezwHd8aD5yBE4DlYq6vSz/AcxHMQvPd4DuI5uDeeoBVxi+E5+MXgOeibi/YzjOapRzzH4b3SOvyexXs8BwGOg3YAgAS0AwAkoB0AIAHtAAAJaAcASEA7AEAC2gEAEtAOAJCAdgCABLQDACSgHQAgAe0AAAloBwBIQDsAQALaAQAS/gNL/gA3PH3hCgAAAABJRU5ErkJggg==" alt="" />
扩展 extend
name = ["Alex","Eenglan","Eric","Rain","World","Tom"]
b = ["","",""]
name.extend(b) #列表中使用列表
print(name)
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfoAAAAgCAIAAAB1pS3jAAAEAUlEQVR4nO2c25ncIAxG6Sp0kgpMOTSQNpZmlmImD9gYbPBthOfCOQ/5PN61JG4/Qp6NegAAQAeoVwcAAAB3gNwDAHQBcg8A0AXIPQBAFxTk3hmllFJKWx8+GdfE9TXL7eK5xru1gnju8SUVYTvvX2HZWx3U6K0W/cdSkntrffLJ6PRjgWlEzg7IvmW5p/b5kFbsrpnO48moj2n4Sbj/2nnYzvs3WfbWIvcCbMu9t7rY/etFfnbDr1k+/dR0FhFJAd6/Fd4OGw6bxLNp8Z54nFFKD4NW2lpzcphrY+qMMj8vnodi3qcYomM5y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VORK5CYII=" alt="" />
拷贝 copy
name = ["Alex","Eenglan","Eric","Rain","World","Tom"]
b = name.copy() #拷贝name的内容
print(b)
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYwAAAAdCAIAAAA2FsxPAAADb0lEQVR4nO2b23neIAyG2aps0gmscbRA14iWCcPQCzDm6AM/tmnzvRd5bLdGQsCHUBxlAQBgYtTbDgAAwB4QKQDA1ECkAABTA5ECAExNXaSElFJKKc3G3ZHcYr2v5fv86WO2XsCfZ2yN8rBox7B262+qaf4eDZFiNtEd6fi2whrVq0E9bnncW8f8I704XBs/3J+E9pi6f3HP352HrXYMM0TK2hMiZVhXQ1hOzasbS6vly2+ted+QzWf+Xhhedgze4s9ui8/4I6SUXhatNDNdHObWmAop+np5Hu5Yh0h5zmRSNQzrfCBePIVtpo89P93U4wzsxRBWfwzrCQ4ebskKs7FG5FJ49kRqXL+8g67NESMIkfL0ipSQIqJkiF9f3kMc+D96MYTZRGphY4VIrMg1b54RKefV2uZVHytApDydIiWkSAzreIxb9b9QfXfX7mLspA+JdtRsxTox6+TwUknQ816kRcxGO3f0wt+ReA/Sh/F7d9VZt+iEhnNTuT93xkeIxLDWLFEiFY9yNWLeqyLpV0ppfYP47q0Cw9pZXQ+uR5VeiJS1tlek/EFaKA50NjzhsB3qgk7U9ksYfZQ5SGldaJvLmR7FL2a9qP7nrJ37eiFUWetlnIOA3eFPvBWdjNg98THMIkJEJPkob4WdkxFb37pdpBIPv/2KCT/3rUOkPH0iFWUgSVqST9ZiJ05lbRiRaZ9ml9YrCyzkBW2pLfOJ6kK9rxeliZaMDiecXKiWe56X9WH+8MIivCxSTLl9o495eGDrK9mHIFJn6RKpKBmKJnArk7LWmCST0jtj8+EXK8Gz0vpnE3rbdc9M8VG9OOPh5ll7Un/oT9haqlWqDgno8yeqSoUnlUzqTMTC8XCsh21bWyYFkbpMh0iF6lK4pj9rSpJkJUkBI+Th+zWpnm9PKpWlqnV3HZdRojedfNYTROWLCOrX8rvazh29aGWrRUfDw7bND/wJohRHzEVD83fuTyPOI/yxPr9Mf7VXqUklodgbUyJqzsQ+D1dr8bt5TWo1S7WDadYaRMpae+6L88fo+2Klm53Cyic83ItD4M9V3vYQX5yn/Oi/3atvswCAmfjRIgUAmB+IFABgaiBSAICpgUgBAKYGIgUAmBqIFABgaiBSAICpgUgBAKYGIgUAmBqIFABgaiBSAICpgUgBAKbmL4+o9y8JaA0DAAAAAElFTkSuQmCC" alt="" />
统计 count
name = ["Alex","Alex","Eric","Alex","World","Tom"]
print(name.count("Alex")) #统计Alex有几个
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAATQAAAAmCAIAAADFivDsAAAAxUlEQVR4nO3asQ1CIRRA0T+WEzGO2zCNC7CFFkZ7SUhu4jnVK2luIMC11lprPYGYS5zQJE6IEidEiROifoxzjutjzJPrgr/3W5zjdn+8p8f9Jk84afdYO4c24aiNOOdwqIXz7JwQtX1bq044a/dCaI7rOwMHbD+l2DbhLJ8QIEqcECVOiBInRIkTosQJUeKEKHFClDghSpwQJU6IEidEiROixAlR4oQocUKUOCFKnBAlTogSJ0SJE6LECVHihChxQpQ4IeoFStRmYgq+oNwAAAAASUVORK5CYII=" alt="" />
排序&反转 sort & reverse
name = ["Alex","Lilei","Eric","","",""]
name.sort() #排序,ask码排序
print(name)
name.reverse() #反转排序
print(name)
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAY8AAAA+CAIAAABcGQDUAAAEAklEQVR4nO3c22GjOhSFYcqioaNyaODUQTUUwzxgsLgJoWhjLfF/T0kmiI0GVmSMdzMCgILm1wUAQBTSCoAG0gqABtIKgAbSCoAG0gqAhti06l3TNE3TtN0wfef66y0ufydtK8WR01DPn/c1dO105j5WAsxEp1XXDd53rvW/Pd4i4nfSttIbeb5k7l4xdkd6suFFhab1rPYePWObms/2NXQdaSUvIa2Grj0+I3q3nDenvxN0tNXyt/Fz5uYbeV4u5h/5M/rmSru7xMhWj3e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sAGkgrABr+ATgWk9/UonR+AAAAAElFTkSuQmCC" alt="" />
获取下标 index
name = ["Alex","Lilei","Eric","","",""]
print(name.index("Lilei")) #获取Lilei的下标
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeYAAAAjCAIAAADOoz4rAAAAuklEQVR4nO3bwQ0CMQwAQVebDtNTuoAKeBAJHSvNVODXyg97zjnnnBcAf28kG6BCsgEyJBsgQ7IBMiQbIEOyATJukr3X2j8aB4DPvkz2XjMzI9kAD7jYsveSbIAnSDZAhmQDZEg2QIZkA2TcXYy4GgF4gFcagAzJBsiQbIAMyQbIkGyADMkGyJBsgAzJBsiQbIAMyQbIkGyADMkGyJBsgAzJBsiQbIAMyQbIkGyADMkGyJBsgAzJBsh4A7DwZkopAqjpAAAAAElFTkSuQmCC" alt="" />
元组
元组和列表差不多,就是存放一组数据,只不过一旦创建不能修改,而列表可以修改
name = ("Alex","Lilei","Eric","Lilei","","")
print(name.index("Lilei")) #获取Lilei的下标,但是只能找到第一个
print(name.count("Lilei")) #获取Lilei的重复次数
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqMAAAA2CAIAAAB8yQfmAAABVklEQVR4nO3dsU3FMBRAUY+Vhcg43ibTZAG2gAKBPq0DknV1TpUy3ZX1nuzx/tsHABAylB4AwpQeAMqUHgDKlB4Ayh6V/jrP65/+CwD4C6ulv84xxhhKDwBbe3Kmv06lB4C9KT0AlCk9AJQpPQCUKT0AlD3cvbd/DwBbc3MOAJQpPQCUKT0AlCk9AJQpPQCUKT0AlCk9AJQpPQCUKT0AlCk9AJQpPQCUrZb+nod77wFge4uln2/z/vq6Tq0HgG0tlv7lvVpv1wLAvp7O6e95HN/HewBgN49KL/MAsLn10l/nkHkA2Nxi6e95/Azn7znN6QFgT8sbeS8c7QFgV27OAYAypQeAMqUHgDKlB4AypQeAMqUHgDKlB4AypQeAMqUHgDKlB4AypQeAMqUHgDKlB4AypQeAMqUHgDKlB4AypQeAMqUHgDKlB4AypQeAMqUHgDKlB4CyTx4r+s/canJsAAAAAElFTkSuQmCC" alt="" />
字符串操作
移出空白
msg=' asdada\n'
print(msg.strip())
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcEAAAAmCAIAAAAz77cxAAABiUlEQVR4nO3dMWrCUBjA8RwzXqOxnsLRIzjFJVsd3B2yCZ7AOmT0BK9DjY0WjHwkKYXfDwcx74Fv+fMZEbMEQFT2128A4B/TUIA4DQWIe9bQLMuyLJvNNxM8JjswwIA0FCBOQwHiNBQgbpiG5sW2alJKp1VRxtZMdFyAQQ02h+bFvn7a0OdrJjswwIA0FCBOQwHi+hv6/bxeX8O3OrSXm+OiKGfzTb4+pZRSczm3fVzsLg+7eteMcDSA0fU3dFWUt/nx9yCZF9uquVTLMl8ez/drOk/610x2YIABvTqH3r5Pz4t9nVJKl2pZdj+ed/N6nTrbXa+sGeVwACN7bQ7tzI/VbnufznbGXJ8ei/mzq3/NZAcGGNBrc2jzWTcpNcf3t4+qaS8f9nf3Og+nun2xvft53bUoyt41Ix0PYFR+pwQQp6EAcRoKEKehAHEaChCnoQBx/k8JIE5DAeI0FCBOQwHiNBQgTkMB4jQUIE5DAeI0FCBOQwHiNBQgTkMB4jQUIE5DAeI0FCDuC07DdHVwhg4vAAAAAElFTkSuQmCC" alt="" />
分割取值
msg='my name is lilei'
print(msg[4:6])
print(msg[4])
print(msg[4:6:2]) #4-6范围内每隔2个取一个
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbEAAAA/CAIAAADhf2H6AAABT0lEQVR4nO3du23DMBiF0X+SZA0uJI6jacxpNIxTKPZFuohAHibOKQgBblR9kKzi1h2Ah/rrGwD4RzQRIDQRIC408dhbVVVVH+d1a62qbVurth8/d4sAv+b7TRy9+nhc3O6jV9uP53n+BPDarrw7j16fzib28eUEeHnXnxOPvWkisKjrz4lt21rV23tV9d6fp78UgQX47gwQmggQmggQmggQmggQmggQmggQmggQmggQmggQmggQmggQmggQmggQk9sDAEua3B5QRWBJk9sDmggsaXJ7QBOBJc1uD5gaAFbkuzNAaCJAaCJAaCJAaCJAaCJAaCJAaCJAaCJAaCJAaCJAaCJAaCJAaCJA2B4ACNsDAGF7ACBsDwCE7QGA8N0ZIDQRIDQRIDQRIDQRIDQRIDQRIDQRIDQRIDQRIDQRIDQRIDQRIDQRIDQRIDQRID4AKIjRcAASF/kAAAAASUVORK5CYII=" alt="" />
长度
lilei=''
print(len(lilei)) #查看变量的长度
运行如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYgAAAAnCAIAAACaHEj+AAAA2klEQVR4nO3awWkDMRBA0S1rG7LK2W5UTYqJLzaBnESwlQ9+r4I5fWaQjm+AmOO/BwD4TZiAHGECcoQJyBEmIEeYgJzVMF3n8eO8vt46FPDZVsM0pxYBmwgTkLN8yt1up0MO2GJ5Y7qeOZpDmoC3+sOr3BzHmK+fBOBhNUzjtDEBmyxvTHP4LADs4YMlkCNMQI4wATnCBOQIE5AjTECOMAE5wgTkCBOQI0xAjjABOcIE5AgTkCNMQI4wATnCBOQIE5AjTECOMAE5wgTkCBOQI0xAjjABOcIE5NwB4mtO0NVPIocAAAAASUVORK5CYII=" alt="" />
字符串工厂函数
class str(object):
"""
str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str Create a new string object from the given object. If encoding or
errors is specified, then the object must expose a data buffer
that will be decoded using the given encoding and error handler.
Otherwise, returns the result of object.__str__() (if defined)
or repr(object).
encoding defaults to sys.getdefaultencoding().
errors defaults to 'strict'.
"""
def capitalize(self): # real signature unknown; restored from __doc__
"""
首字母变大写
S.capitalize() -> str Return a capitalized version of S, i.e. make the first character
have upper case and the rest lower case.
"""
return "" def casefold(self): # real signature unknown; restored from __doc__
"""
S.casefold() -> str Return a version of S suitable for caseless comparisons.
"""
return "" def center(self, width, fillchar=None): # real signature unknown; restored from __doc__
"""
原来字符居中,不够用空格补全
S.center(width[, fillchar]) -> str Return S centered in a string of length width. Padding is
done using the specified fill character (default is a space)
"""
return "" def count(self, sub, start=None, end=None): # real signature unknown; restored from __doc__
"""
从一个范围内的统计某str出现次数
S.count(sub[, start[, end]]) -> int Return the number of non-overlapping occurrences of substring sub in
string S[start:end]. Optional arguments start and end are
interpreted as in slice notation.
"""
return 0 def encode(self, encoding='utf-8', errors='strict'): # real signature unknown; restored from __doc__
"""
encode(encoding='utf-8',errors='strict')
以encoding指定编码格式编码,如果出错默认报一个ValueError,除非errors指定的是
ignore或replace S.encode(encoding='utf-8', errors='strict') -> bytes Encode S using the codec registered for encoding. Default encoding
is 'utf-8'. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
'xmlcharrefreplace' as well as any other name registered with
codecs.register_error that can handle UnicodeEncodeErrors.
"""
return b"" def endswith(self, suffix, start=None, end=None): # real signature unknown; restored from __doc__
"""
S.endswith(suffix[, start[, end]]) -> bool Return True if S ends with the specified suffix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
suffix can also be a tuple of strings to try.
"""
return False def expandtabs(self, tabsize=8): # real signature unknown; restored from __doc__
"""
将字符串中包含的\t转换成tabsize个空格
S.expandtabs(tabsize=8) -> str Return a copy of S where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
"""
return "" def find(self, sub, start=None, end=None): # real signature unknown; restored from __doc__
"""
S.find(sub[, start[, end]]) -> int Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation. Return -1 on failure.
"""
return 0 def format(self, *args, **kwargs): # known special case of str.format
"""
格式化输出
三种形式:
形式一.
>>> print('{0}{1}{0}'.format('a','b'))
aba 形式二:(必须一一对应)
>>> print('{}{}{}'.format('a','b'))
Traceback (most recent call last):
File "<input>", line 1, in <module>
IndexError: tuple index out of range
>>> print('{}{}'.format('a','b'))
ab 形式三:
>>> print('{name} {age}'.format(age=12,name='lhf'))
lhf 12 S.format(*args, **kwargs) -> str Return a formatted version of S, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}').
"""
pass def format_map(self, mapping): # real signature unknown; restored from __doc__
"""
与format区别
'{name}'.format(**dict(name='alex'))
'{name}'.format_map(dict(name='alex')) S.format_map(mapping) -> str Return a formatted version of S, using substitutions from mapping.
The substitutions are identified by braces ('{' and '}').
"""
return "" def index(self, sub, start=None, end=None): # real signature unknown; restored from __doc__
"""
S.index(sub[, start[, end]]) -> int Like S.find() but raise ValueError when the substring is not found.
"""
return 0 def isalnum(self): # real signature unknown; restored from __doc__
"""
至少一个字符,且都是字母或数字才返回True S.isalnum() -> bool Return True if all characters in S are alphanumeric
and there is at least one character in S, False otherwise.
"""
return False def isalpha(self): # real signature unknown; restored from __doc__
"""
至少一个字符,且都是字母才返回True
S.isalpha() -> bool Return True if all characters in S are alphabetic
and there is at least one character in S, False otherwise.
"""
return False def isdecimal(self): # real signature unknown; restored from __doc__
"""
S.isdecimal() -> bool Return True if there are only decimal characters in S,
False otherwise.
"""
return False def isdigit(self): # real signature unknown; restored from __doc__
"""
S.isdigit() -> bool Return True if all characters in S are digits
and there is at least one character in S, False otherwise.
"""
return False def isidentifier(self): # real signature unknown; restored from __doc__
"""
字符串为关键字返回True S.isidentifier() -> bool Return True if S is a valid identifier according
to the language definition. Use keyword.iskeyword() to test for reserved identifiers
such as "def" and "class".
"""
return False def islower(self): # real signature unknown; restored from __doc__
"""
至少一个字符,且都是小写字母才返回True
S.islower() -> bool Return True if all cased characters in S are lowercase and there is
at least one cased character in S, False otherwise.
"""
return False def isnumeric(self): # real signature unknown; restored from __doc__
"""
S.isnumeric() -> bool Return True if there are only numeric characters in S,
False otherwise.
"""
return False def isprintable(self): # real signature unknown; restored from __doc__
"""
S.isprintable() -> bool Return True if all characters in S are considered
printable in repr() or S is empty, False otherwise.
"""
return False def isspace(self): # real signature unknown; restored from __doc__
"""
至少一个字符,且都是空格才返回True
S.isspace() -> bool Return True if all characters in S are whitespace
and there is at least one character in S, False otherwise.
"""
return False def istitle(self): # real signature unknown; restored from __doc__
"""
>>> a='Hello'
>>> a.istitle()
True
>>> a='HellP'
>>> a.istitle()
False S.istitle() -> bool Return True if S is a titlecased string and there is at least one
character in S, i.e. upper- and titlecase characters may only
follow uncased characters and lowercase characters only cased ones.
Return False otherwise.
"""
return False def isupper(self): # real signature unknown; restored from __doc__
"""
S.isupper() -> bool Return True if all cased characters in S are uppercase and there is
at least one cased character in S, False otherwise.
"""
return False def join(self, iterable): # real signature unknown; restored from __doc__
"""
#对序列进行操作(分别使用' '与':'作为分隔符)
>>> seq1 = ['hello','good','boy','doiido']
>>> print ' '.join(seq1)
hello good boy doiido
>>> print ':'.join(seq1)
hello:good:boy:doiido #对字符串进行操作 >>> seq2 = "hello good boy doiido"
>>> print ':'.join(seq2)
h:e:l:l:o: :g:o:o:d: :b:o:y: :d:o:i:i:d:o #对元组进行操作 >>> seq3 = ('hello','good','boy','doiido')
>>> print ':'.join(seq3)
hello:good:boy:doiido #对字典进行操作 >>> seq4 = {'hello':1,'good':2,'boy':3,'doiido':4}
>>> print ':'.join(seq4)
boy:good:doiido:hello #合并目录 >>> import os
>>> os.path.join('/hello/','good/boy/','doiido')
'/hello/good/boy/doiido' S.join(iterable) -> str Return a string which is the concatenation of the strings in the
iterable. The separator between elements is S.
"""
return "" def ljust(self, width, fillchar=None): # real signature unknown; restored from __doc__
"""
S.ljust(width[, fillchar]) -> str Return S left-justified in a Unicode string of length width. Padding is
done using the specified fill character (default is a space).
"""
return "" def lower(self): # real signature unknown; restored from __doc__
"""
S.lower() -> str Return a copy of the string S converted to lowercase.
"""
return "" def lstrip(self, chars=None): # real signature unknown; restored from __doc__
"""
S.lstrip([chars]) -> str Return a copy of the string S with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
"""
return "" def maketrans(self, *args, **kwargs): # real signature unknown
"""
Return a translation table usable for str.translate(). If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters to Unicode ordinals, strings or None.
Character keys will be then converted to ordinals.
If there are two arguments, they must be strings of equal length, and
in the resulting dictionary, each character in x will be mapped to the
character at the same position in y. If there is a third argument, it
must be a string, whose characters will be mapped to None in the result.
"""
pass def partition(self, sep): # real signature unknown; restored from __doc__
"""
以sep为分割,将S分成head,sep,tail三部分 S.partition(sep) -> (head, sep, tail) Search for the separator sep in S, and return the part before it,
the separator itself, and the part after it. If the separator is not
found, return S and two empty strings.
"""
pass def replace(self, old, new, count=None): # real signature unknown; restored from __doc__
"""
S.replace(old, new[, count]) -> str Return a copy of S with all occurrences of substring
old replaced by new. If the optional argument count is
given, only the first count occurrences are replaced.
"""
return "" def rfind(self, sub, start=None, end=None): # real signature unknown; restored from __doc__
"""
S.rfind(sub[, start[, end]]) -> int Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation. Return -1 on failure.
"""
return 0 def rindex(self, sub, start=None, end=None): # real signature unknown; restored from __doc__
"""
S.rindex(sub[, start[, end]]) -> int Like S.rfind() but raise ValueError when the substring is not found.
"""
return 0 def rjust(self, width, fillchar=None): # real signature unknown; restored from __doc__
"""
S.rjust(width[, fillchar]) -> str Return S right-justified in a string of length width. Padding is
done using the specified fill character (default is a space).
"""
return "" def rpartition(self, sep): # real signature unknown; restored from __doc__
"""
S.rpartition(sep) -> (head, sep, tail) Search for the separator sep in S, starting at the end of S, and return
the part before it, the separator itself, and the part after it. If the
separator is not found, return two empty strings and S.
"""
pass def rsplit(self, sep=None, maxsplit=-1): # real signature unknown; restored from __doc__
"""
S.rsplit(sep=None, maxsplit=-1) -> list of strings Return a list of the words in S, using sep as the
delimiter string, starting at the end of the string and
working to the front. If maxsplit is given, at most maxsplit
splits are done. If sep is not specified, any whitespace string
is a separator.
"""
return [] def rstrip(self, chars=None): # real signature unknown; restored from __doc__
"""
S.rstrip([chars]) -> str Return a copy of the string S with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
"""
return "" def split(self, sep=None, maxsplit=-1): # real signature unknown; restored from __doc__
"""
以sep为分割,将S切分成列表,与partition的区别在于切分结果不包含sep,
如果一个字符串中包含多个sep那么maxsplit为最多切分成几部分
>>> a='a,b c\nd\te'
>>> a.split()
['a,b', 'c', 'd', 'e']
S.split(sep=None, maxsplit=-1) -> list of strings Return a list of the words in S, using sep as the
delimiter string. If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None, any
whitespace string is a separator and empty strings are
removed from the result.
"""
return [] def splitlines(self, keepends=None): # real signature unknown; restored from __doc__
"""
Python splitlines() 按照行('\r', '\r\n', \n')分隔,
返回一个包含各行作为元素的列表,如果参数 keepends 为 False,不包含换行符,如 果为 True,则保留换行符。
>>> x
'adsfasdf\nsadf\nasdf\nadf'
>>> x.splitlines()
['adsfasdf', 'sadf', 'asdf', 'adf']
>>> x.splitlines(True)
['adsfasdf\n', 'sadf\n', 'asdf\n', 'adf'] S.splitlines([keepends]) -> list of strings Return a list of the lines in S, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
is given and true.
"""
return [] def startswith(self, prefix, start=None, end=None): # real signature unknown; restored from __doc__
"""
S.startswith(prefix[, start[, end]]) -> bool Return True if S starts with the specified prefix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
prefix can also be a tuple of strings to try.
"""
return False def strip(self, chars=None): # real signature unknown; restored from __doc__
"""
S.strip([chars]) -> str Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
"""
return "" def swapcase(self): # real signature unknown; restored from __doc__
"""
大小写反转
S.swapcase() -> str Return a copy of S with uppercase characters converted to lowercase
and vice versa.
"""
return "" def title(self): # real signature unknown; restored from __doc__
"""
S.title() -> str Return a titlecased version of S, i.e. words start with title case
characters, all remaining cased characters have lower case.
"""
return "" def translate(self, table): # real signature unknown; restored from __doc__
"""
table=str.maketrans('alex','big SB') a='hello abc'
print(a.translate(table)) S.translate(table) -> str Return a copy of the string S in which each character has been mapped
through the given translation table. The table must implement
lookup/indexing via __getitem__, for instance a dictionary or list,
mapping Unicode ordinals to Unicode ordinals, strings, or None. If
this operation raises LookupError, the character is left untouched.
Characters mapped to None are deleted.
"""
return "" def upper(self): # real signature unknown; restored from __doc__
"""
S.upper() -> str Return a copy of S converted to uppercase.
"""
return "" def zfill(self, width): # real signature unknown; restored from __doc__
"""
原来字符右对齐,不够用0补齐 S.zfill(width) -> str Pad a numeric string S with zeros on the left, to fill a field
of the specified width. The string S is never truncated.
"""
return "" def __add__(self, *args, **kwargs): # real signature unknown
""" Return self+value. """
pass def __contains__(self, *args, **kwargs): # real signature unknown
""" Return key in self. """
pass def __eq__(self, *args, **kwargs): # real signature unknown
""" Return self==value. """
pass def __format__(self, format_spec): # real signature unknown; restored from __doc__
"""
S.__format__(format_spec) -> str Return a formatted version of S as described by format_spec.
"""
return "" def __getattribute__(self, *args, **kwargs): # real signature unknown
""" Return getattr(self, name). """
pass def __getitem__(self, *args, **kwargs): # real signature unknown
""" Return self[key]. """
pass def __getnewargs__(self, *args, **kwargs): # real signature unknown
pass def __ge__(self, *args, **kwargs): # real signature unknown
""" Return self>=value. """
pass def __gt__(self, *args, **kwargs): # real signature unknown
""" Return self>value. """
pass def __hash__(self, *args, **kwargs): # real signature unknown
""" Return hash(self). """
pass def __init__(self, value='', encoding=None, errors='strict'): # known special case of str.__init__
"""
str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str Create a new string object from the given object. If encoding or
errors is specified, then the object must expose a data buffer
that will be decoded using the given encoding and error handler.
Otherwise, returns the result of object.__str__() (if defined)
or repr(object).
encoding defaults to sys.getdefaultencoding().
errors defaults to 'strict'.
# (copied from class doc)
"""
pass def __iter__(self, *args, **kwargs): # real signature unknown
""" Implement iter(self). """
pass def __len__(self, *args, **kwargs): # real signature unknown
""" Return len(self). """
pass def __le__(self, *args, **kwargs): # real signature unknown
""" Return self<=value. """
pass def __lt__(self, *args, **kwargs): # real signature unknown
""" Return self<value. """
pass def __mod__(self, *args, **kwargs): # real signature unknown
""" Return self%value. """
pass def __mul__(self, *args, **kwargs): # real signature unknown
""" Return self*value.n """
pass @staticmethod # known case of __new__
def __new__(*args, **kwargs): # real signature unknown
""" Create and return a new object. See help(type) for accurate signature. """
pass def __ne__(self, *args, **kwargs): # real signature unknown
""" Return self!=value. """
pass def __repr__(self, *args, **kwargs): # real signature unknown
""" Return repr(self). """
pass def __rmod__(self, *args, **kwargs): # real signature unknown
""" Return value%self. """
pass def __rmul__(self, *args, **kwargs): # real signature unknown
""" Return self*value. """
pass def __sizeof__(self): # real signature unknown; restored from __doc__
""" S.__sizeof__() -> size of S in memory, in bytes """
pass def __str__(self, *args, **kwargs): # real signature unknown
""" Return str(self). """
pass
常用的,控制变量的类型
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnoAAAGTCAMAAACI10/pAAAAAXNSR0IArs4c6QAAAOFQTFRFQEBAVVVVTExMoKCgAM3NPj5MYT4+m8OP/2ZmQkJCWkYA/2Rb/1hMm5papUQ+m61oUD4+xWRiPkxYZFJebq2NhT8+fGw+D8vLhVhjXpmNPmx0Pj5ZxUw+PlZoPj5EPkRSYmJil5eXp6enRkZGND4+i8GNPliJ4VJEpV5kALSKmcF0blY+/15SfMGNm8GBUYWA4WRkAKFwLKHLi4VMFnVEPnChAMu1Ilg+Nkk2IrXL4WJW4WRepVZSAMuhPj5wxVRIFGsUb6yBMYmwxWJWZE1SEG4QGGgYmJUxfWEAfWRiZUMzuZIfUAAAIABJREFUeNrtnY1/2tbVgJU2YFIEey0FR2AC3dYUL3NqN267NnXrLfH78f//Re/91jn3Q0gCCUmcs583C4mLMh6f+/0oeiUjoqBoOQg9CkKPgtCjoCD0KAg9CgpCj4LQo6Ag9CgIPQoKQo+C0KOgIPQoCD0KQo/QoyD0KAg9CgpCj4LQo6Ag9CgIPQoKQo+C0KOgIPQoCL2BRxJXf8Pocg1e2H6ai/9NdweXTeidVaTTufXK8wKcnTs8TW7Ho8vbscTuif38Po+S6XxzM9ntL5vQK47Rf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J5CchdFrUnKm5tEWChvR3RVfrxkc0aMZvFLOzCIUOKQM0eMjImsXKVRa+EDgnY/rgaLt2xk4eu1KzgrQa1Byxqcw9GCKGr2T0/z4uxawrfMJtzSEHj+zq4+e6sia2Yy8aHFdrP5Kht/WOyTOVXKm+gMUp0PvTCVnLHPa8xoUbaN3jpIz3tIrtwiGokH0zlFyxtCLiafTo0eSM4rK6PU/aDMkoUfoURB6FITeSdH7e/TVX9v4iaJf/6edH0KvJ+h9/eLrb9v4+fev7fyH0OsNei/+9lUrP7/+96+t/BB6FBSEHgWhR0FB6FEQehQUhB4FoUdB6FFQtBr/D8hH6DhHL0VQAAAAAElFTkSuQmCC" alt="" />
python之列表、字典、集合的更多相关文章
- Python 高效编程技巧实战(2-1)如何在列表,字典, 集合中根据条件筛选数据
Python 高效编程技巧实战(2-1)如何在列表,字典, 集合中根据条件筛选数据 学习目标 1.学会使用 filter 借助 Lambda 表达式过滤列表.集合.元组中的元素: 2.学会使用列表解析 ...
- python :列表 字典 集合 类 ----局部变量可以改全局变量
#列表 字典 集合 类 ----局部变量可以改全局变量,除了整数和字符串 names=["alex","jack","luck"] def ...
- python基础一 -------如何在列表字典集合中根据条件筛选数据
如何在列表字典集合中根据条件筛选数据 一:列表 先随机生成一个列表,过滤掉负数 1,普通for循环迭代判断 2,filter()函数判断,filter(函数,list|tuple|string) fi ...
- python字符串/列表/字典互相转换
python字符串/列表/字典互相转换 目录 字符串与列表 字符串与字典 列表与字典 字符串与列表 字符串转列表 1.整体转换 str1 = 'hello world' print(str1.spli ...
- Python基础2 列表 字典 集合
本节内容 列表.元组操作 字符串操作 字典操作 集合操作 文件操作 字符编码与转码 1. 列表.元组操作 列表是我们最以后最常用的数据类型之一,通过列表可以对数据实现最方便的存储.修改等操作 定义列表 ...
- Python迭代器生成器,私有变量及列表字典集合推导式(二)
1 python自省机制 这个是python一大特性,自省就是面向对象的语言所写的程序在运行时,能知道对象的类型,换句话说就是在运行时能获取对象的类型,比如通过 type(),dir(),getatt ...
- 如何在列表,字典,集合中,根据条件筛选数据 -- Python数据结构与算法相关问题与解决技巧
实际案例: 1.过滤掉列表 [3,9,-1,10,20,-2..]的负数 2.筛出字典{'LiLei':79,'Jim':88,'Lucy':92...}中值高于90的项 3.筛出集合 {77,89, ...
- Python 全栈开发二 python基础 字符串 字典 集合
一.字符串 1,在python中,字符串是最为常见的数据类型,一般情况下用引号来创建字符串. >>ch = "wallace" >>ch1 = 'walla ...
- 【Python3】列表字典集合元组
1 列表 1.1 定义与索引 在Python中,第一个列表元素的下标为 0通过将索引指定为 -1 可以让Python返回最后一个列表元素 inventory = ['sword', 'armor', ...
- 初识python 字符串 列表 字典相关操作
python基础(一): 运算符: 算术运算: 除了基本的+ - * / 以外,还需要知道 : // 为取整除 返回的市商的整数部分 例如: 9 // 2 ---> 4 , 9.0 // ...
随机推荐
- HTML中的select只读
因为Select下拉框只支持disabled属性,不支持readOnly属性,而在提交时,disabled的控件,又是不提交值的.现提供以下几种解决方案: 1.在html中使用以下代码,在select ...
- jquery mobile上传图片完整例子(包含ios图片横向问题处理和C#后台图片压缩)
上传图片本身是个基本的小功能,但是到了移动端就不那么简单了,相信找到这篇文章的你一定有深深的同感. 本文实例是:在(移动端)页面中点击图片,然后选择文件,然后保存.使用Asp.net 难点一:后台获取 ...
- c++ 中的sort用法
别人写的,我拿来做做笔记 sort函数的用法 做ACM题的时候,排序是一种经常要用到的操作.如果每次都自己写个冒泡之类的O(n^2)排序,不但程序容易超时,而且浪费宝贵的比赛时间,还很有可能写错.ST ...
- JAVA开发相关
JAVA开发相关1. IntelliJ IDEA开发工具熟练使用2. Maven3. Spring框架(IoC.AOP) 1)数据库相关MyBatis 2)数据库连接池 3)事务.多数据源.跨数据库分 ...
- mvc导出excel 之 新
前段时间做的mvc导出excel 老大说要进行优化,我原来导出是用npoi插件进行导出,格式是将数据放入到datatable中,然后进行导出. 说要优化的时候就想着将datatable数据导出格式改为 ...
- 【转】 数据库系统——B+树索引
原文来自于:http://blog.csdn.net/cjfeii/article/details/10858721 1. B+树索引概述 在上一篇文章中,我们讨论了关于index的几个中重要的课题: ...
- Liunx的各种小指令
tsshutdown -y ----关闭所有服务tsboot -g COMMON ----启动公共服务tsboot -g ETXX ----启动XX服务 tsma -e oet1 -l 172.X ...
- JSP页面组件
一.JSP指令 1.page指令 定义:将关于JSP页面一般设置通知给web容器的属性. 语法:<%@ page attribute_list%> 属性:language;extends; ...
- angular ng-if scope权限问题
今天在一个ng-if处理的div中处理一个scope,我一开始想要打印这个选中的值,但是一直打印的是为undefined,找了一会,原来是ng-if这个指令单独开了一个作用域,它只可以继承,不可以进行 ...
- pip自动生成requirements.txt依赖关系清单
Python项目中经常会带requirements.txt文件,里面是项目所依赖的包的列表,也就是依赖关系清单,这个清单也可以使用pip命令自动生成. pip命令: 1 pip freeze > ...