Python for IT tasks: variables, operators, data structuresCore syntax for scripts10 minNeedCodeText with valuesf"{host}: {ms:.1f} ms"Integer / float division7 // 2 is 3; 7 / 2 is 3.5Remaindern % 2 == 0 tests evenMembership"up" in status; port in (22, 23)Identity with Noneif result is None:Chained comparison1 <= port <= 65535Conditional valuestate = "up" if ok else "down"Convertint("22"), str(22), float("0.5")TypeMutableTypical IT usestrNoHostnames, command outputint, floatNoPorts, counts, latencyboolNoReachable or notlistYesOrdered device listtupleNoFixed pairs: (host, port)setYesUnique IPs; differences between inventoriesdictYesOne device's settings by nameEverything read from input(), a file, a CSV or command output is str. "22" == 22 is False.Word bankAll definitions →f-stringf"..." with {expressions}; {:.1f} formats one decimal.MutableCan change in place (list, dict, set).Knowledge checkport = "22". port == 22AFalseBTrueCTypeErrorDNoneValid port test for an int p:Ap in 65535B0 < p < 65536Cp is 1..65535Dp == range(65535)Mark doneParsing command output