Preview:
hour = int(input("Введите время: "))
if (hour >= 8 and hour <= 22) and not (hour <= 15 and hour >= 14) and not (hour >=18 and hour <=20):
  print("Можно получить посылку")
else:
  print("Посылку получить нельзя")
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter