D =set( ["Tue","Wed","Thu","Fri","Sat"])
F =set( ["Mon","Tue","Wed"])
# Months = {"Jan", "Feb", "Mar"}
# dates={21,22,23}
D.add("Sun")
D.discard("Sun")
E = D|F
G = D&F
H = F - D
J = D >= F
# K =
print(J)
# print(Months)
# for i in D:
# print(i)
二阶数组
centos7网卡报错,ip地址丢失不见等问题解决方法
问题出现:
ip地址丢失不见,网卡报错,当重启网卡时
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
按照提示输入systemctl status network.service查看报错如下
Failed to start LSB: Bring up/down networking.
解决办法:
系统自带的NetworkManager这个管理套件出错,关掉.
关掉方法:
systemctl stop NetworkManager
systemctl disable NetworkManager
重新启动网络:
systemctl start network.service
class Node:
def __init__(self,datavalue=None):
self.datavalue = datavalue
a = self.datavalue
self.nextvalue = None
b = self.nextvalue
class SLinkedList:
def __init__(self):#链表程序先初始化,获取首地址
self.headnode = None
c = self.headnode
def printvalue(self):
printval = self.headnode
d = printval
while printval:
f = printval
print(printval.datavalue)
e = printval.datavalue
printval = printval.nextvalue
h = printval.nextvalue
list = SLinkedList()#实例化一个list,设首地址
list.headnode = Node("Mon")
e2 = Node("Tue")
e3 = Node("Wed")
list.headnode.nextvalue = e2
e2.nextvalue = e3
list.printvalue()
在链表的表首插入新节点的思路
实例化一个新节点,新节点的nextvalue指向现在链表的首节点的地址,新链表的首地址就是构造新的实例的地址
在链表的表末尾增加节点
实例化一个新的节点,现存的链表的最后一个节点的指针肯定是空,遍历现在的链表,找到指针为空的,将这个指针赋值为新的节点的地址