1#include 2#include 3#include 4 using namespacestd;5 6 intMain ()7 {8 intIa[] = {0,1,1,2,3,5,8, -, +, -, the };9vectorint> Ivec (IA, IA + One);Tenlistint> IList (IA, IA + One); One A //Delete even numbers in a vector - for(Auto iter = Ivec.begin (); ITER! =ivec.end ();) - { the if(*iter%2==0) -ITER =Ivec.erase (ITER); - Else -++iter; + } - + //Delete the odd number in list A for(Auto iter = Ilist.begin (
#-*-Coding: UTF-8 -*-'''Chinese supported@ Author: Tang '''"""Input element"""Def input (mylist, n ):Print "Please input % d numbers:" % (n)For I in range (n ):Num = int (raw_input ())Mylist. append (Num)
"""Delete the elements of the repeated items in the list"""Def dellist (mylist, n ):Mylist. Sort ()Last = mylist [-1]For I in range (n-2,-1,-1 ):If last = mylist [I]:Del mylist [I]Else:Last = mylist [I]
Just in the buckle group to see someone sent a problem, I wrote a bit, not clear there is no better waylist=[5,5,8,9,7,6,5,7,5,8,1,8,4,7]#5,8,7,9,6,1,4result=[]defSocet (arge): Count=1 forIndex,iteminchEnumerate (arge): Item_next=arge[index+1] ifArge.count (item) >=Arge.count (item_next):ifIteminchResult:Pass Else: Result.append (item) Count+=1ifLen (arge) = =Count: forIinchArge:ifIinchResult:Pass Else: Result.append (i)returnresultPrint(Socet (
I. Unordered listFeatures: 1. No order, each 2. By default there is a solid dot in front of each Li tag3. Mainly used for display of unordered type information, such as navigation bar etc.Two. Ordered listFeatures: 1. Sequential, each 2. By default, each Li tag has a sequential identification3. General list of sort types, such as quiz papers, questionnaire options, etc.Three: Definition listFeatures: 1. No order, each DT and DD tag exclusive one row (
If we had such a JSON{"Key1": [1, 2, 3, "A", "B"], "key0": "Str"}Execute the following statementImport Jsonmap = json.loads (open (' Print.json '). Read ()) Print mapThe printed result is preceded by a U:{u ' key1 ': [1, 2, 3, U ' a ', U ' b '], U ' key0 ': U ' str '}So you can dispose of these prefixes in this way, and wrap them in json.dumps before print.Import Jsonmap = json.loads (open (' Print.json '). Read ()) print json.dumps (map)The results are as follows:{"Key1": [1, 2, 3, "A", "B"], "
This paper mainly introduces the simple implementation of jquery to the list dynamically add new elements, involving jquery event response and page element dynamic operation related implementation skills, the need for friends can refer to, hope to help everyone.
First Look at:
The complete implementation code is as follows:
Town Field Poem:——— Dream who feel, the water month Build blog. Baiqian tribulation, only know the vicissitudes of the world.——— today holds the Buddhist language, the technology is boundless willing to learn. Willing to do what you learn, cast a conscience blog.——————————————————————————————————————————1 Code1 alist=[1,2,3,4,5,6,7,213,54,124,774,2312,531,76]23print(alist[1: ])2 Show——————————————————————————————————————————The essence of the blog, in the technical part, more in the town yard a
Town Field Poem:Cheng listens to the Tathagata language, the world name and benefit of Dayton. Be willing to do the Tibetan apostles, the broad show is by Sanfu mention.I would like to do what I learned, to achieve a conscience blog. May all the Yimeimei, reproduce the wisdom of the body.——————————————————————————————————————————Ex——————————————————————————————————————————The essence of the blog, in the technical part, more in the town yard a poem. Python version 3.5, System Windows7.Python is a
Town Field Poem:Cheng listens to the Tathagata language, the world name and benefit of Dayton. Be willing to do the Tibetan apostles, the broad show is by Sanfu mention.I would like to do what I learned, to achieve a conscience blog. May all the Yimeimei, reproduce the wisdom of the body.——————————————————————————————————————————Codemember=[' wisdom ', ' fulfillment ', ' Kwan-Yin ', ' Maitreya ', ']print ' (member) #显然舍名利, but also need to cultivate a lot of excellent quality, then first take ou
Town Field Poem:Cheng listens to the Tathagata language, the world name and benefit of Dayton. Be willing to do the Tibetan apostles, the broad show is by Sanfu mention.I would like to do what I learned, to achieve a conscience blog. May all the Yimeimei, reproduce the wisdom of the body.——————————————————————————————————————————Ex#列表中的列表算一个元素——————————————————————————————————————————The essence of the blog, in the technical part, more in the town yard a poem. Python version 3.5, System Windows7
Package Cn.php;import Java.util.arraylist;import Java.util.arrays;import java.util.collections;import Java.util.comparator;import Java.util.hashmap;import Java.util.hashset;import Java.util.LinkedHashMap;import Java.util.list;import java.util.map;import Java.util.map.entry;import Java.util.set;public class CountList {public static void Main (string[] args) {listPublic mapThe number of occurrences of elements in the Java statistics
HTML5 BASICS (1)-elements, attributes, formatting, style, Link, table, list, block, layout, html5 Layout
Start to learn html5 and record your learning notes. The code is basically:Development tools:Intellij IDEAOrHBuilder The first thing to learn is the html tag language. In fact, w3cschool is available. I have uploaded an electronic version of W3Cschool and can download it for more comprehensive use.On th
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.