有没有办法检查列表是否是另一个列表的子列表?

时间:2015-06-29 02:17:24

标签: python

所以说我有

x = [1,2,3,4,5,6]
y = [2,3,4]

有没有办法检查y中的x是否完全符合其中的顺序?

如果true位于y,那么if x就像import UIKit import Parse import Starscream class ViewController: UIViewController, WebSocketDelegate { var socket = WebSocket(url: NSURL(scheme: "ws", host: "ws.pusherapp.com/app/API_KEY?protocol=7", path: "/")!) override func viewDidLoad() { super.viewDidLoad() self.socket.delegate = self self.socket.connect() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func disconnectWasTapped(sender: UIButton) { self.socket.disconnect() } // MARK: WebSocket func websocketDidConnect(socket: WebSocket) { println("websocket is connected") } func websocketDidDisconnect(socket: WebSocket, error: NSError?) { println("websocket is disconnected: \(error?.localizedDescription)") } func websocketDidReceiveMessage(socket: WebSocket, text: String) { //println("got some text!!") println("got some text: \(text)") } func websocketDidReceiveData(socket: WebSocket, data: NSData) { println("got some data: \(data.length)") } } 一样?

0 个答案:

没有答案