hui
This commit is contained in:
@@ -38,4 +38,5 @@ print(pop_value)
|
||||
|
||||
print("-"*50)
|
||||
key, value = mydict.popitem()
|
||||
print(mydict)
|
||||
print(mydict)
|
||||
|
||||
|
||||
20
Montag/if.py
Normal file
20
Montag/if.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
mydict = { 'hostname' : "notebook43",
|
||||
'address': '192.168.1.243',
|
||||
'OS' : 'Debian 5.10.149-2',
|
||||
'ssd' : True,
|
||||
'ramsize' : 16,
|
||||
'maker' : "Lenovo",
|
||||
'type' : "T232"
|
||||
}
|
||||
|
||||
if 'maker' in mydict:
|
||||
print("Key exist")
|
||||
|
||||
if 'maker' in mydict and 'type' in mydict:
|
||||
if mydict['maker'] =='Lenovo' and mydict['type'].startswith('T'):
|
||||
print("Es ist ein Thinkpad")
|
||||
|
||||
Reference in New Issue
Block a user