21 lines
466 B
Python
Executable File
21 lines
466 B
Python
Executable File
#! /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")
|
|
|