Advertisement
Sabbir-bin

nasted if-- else

Jun 17th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. x= int(input("Enter the value of x:"))
  2.  
  3. if x<0:
  4.     print("x is negaitve")
  5. else:
  6.         print("x is positive")
  7.         if(x%2)==0:
  8.             print("x is even number")
  9.         else:
  10.             print("x is odd number")
  11.        
  12. name = input ("Enter your name: ")
  13.  
  14. if name == "Sabbir":
  15.     print("Your entered name was correct .So, hellow Mr.", name)
  16. elif name == "Sadia":
  17.     print("Your entered name was correct .So, hellow Mr.", name)
  18. elif name =="Sami":
  19.     print("Your entered name was correct .So, hellow Mr.", name)
  20. elif name == "linux":
  21.     print("Your entered name was correct .So, hellow Mr.", name)
  22.  
  23. else:
  24.         print("Your entered name is invaild!")
  25.  
  26. input ("Enter any key to exit")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement