Advertisement
Yahya-Ak-Ayoub

Q2

Mar 19th, 2021
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. from turtledemo.chaos import f
  2. from typing import io
  3.  
  4. input = input("Enter a statement condition")
  5. flag = False
  6. try:
  7.   input = input.strip()
  8.   if input[2] == ' ' and  input[0:3].strip().lower() == "if" and input[len(input)-1] == ':':
  9.                 condition = bool(input[3:len(input)-2])
  10.   else :
  11.       flag = True
  12. except:
  13.   flag = True
  14.  
  15. if not flag :
  16.     print("Valid")
  17. else:
  18.     print("not Valiid")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement