TheDeanVanGreunen

‎Serjeel Ranjan‎

Jan 12th, 2020
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. # Main Entry Point
  2. if __name__ == "__main__":
  3.     # Enter Max Value
  4.     n = int(input("Max Value: "))
  5.  
  6.     # Enter Array Values
  7.     arr = map(int, input("Values: ").split())
  8.  
  9.     # Convet array to list
  10.     lis = list(arr)
  11.  
  12.     # Get Max
  13.     p = n # I belive you want to use the value you entered and not the max(lis) value
  14.  
  15.     # Get Output using an inline lambda
  16.     output = [x for x in lis if x <= p] #
Advertisement
Add Comment
Please, Sign In to add comment