This commit is contained in:
2022-11-22 14:45:34 +01:00
parent 8657075f55
commit 2a1f5ea7c6
5 changed files with 115 additions and 1 deletions

20
Montag/if.py Normal file
View 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")