Python Forum
Basic input() function question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic input() function question
#2
inappropriate = "<>#!@$%^&*()_- {}"
if not any(map(lambda char: char in inappropriate, name)):
    # The name is not alright.

the map function is mapping the lambda function with any character in the name.  This will produce a list of the results of the lambda function. And any() returns True if there is not any value in the list which could be considered False - None, 0, False, empty value.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
Basic input() function question - by rebubula76 - Nov-27-2017, 02:46 AM
RE: Basic input() function question - by wavic - Nov-27-2017, 07:47 AM
RE: Basic input() function question - by buran - Nov-27-2017, 08:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  difference between forms of input a list to function akbarza 6 1,163 Feb-21-2024, 08:02 PM
Last Post: bterwijn
  Basic Coding Question: Exit Program Command? RockBlok 3 654 Nov-19-2023, 06:31 PM
Last Post: deanhystad
  Question on dir() function Soorya25 1 1,213 Jan-16-2023, 09:33 PM
Last Post: deanhystad
Information How to take url in telegram bot user input and put it as an argument in a function? askfriends 0 1,165 Dec-25-2022, 03:00 PM
Last Post: askfriends
  Function not scriptable: Noob question kaega2 3 1,244 Aug-21-2022, 04:37 PM
Last Post: kaega2
  Showing an empty chart, then input data via function kgall89 0 1,006 Jun-02-2022, 01:53 AM
Last Post: kgall89
  [solved] Basic question on list matchiing paul18fr 7 1,956 May-02-2022, 01:03 PM
Last Post: DeaD_EyE
  input function question barryjo 12 2,881 Jan-18-2022, 12:11 AM
Last Post: barryjo
  function with 'self' input parameter errors out with and without 'self' called dford 12 3,271 Jan-15-2022, 06:07 PM
Last Post: deanhystad
Big Grin General programming question (input string)[ jamie_01 2 1,651 Jan-08-2022, 12:59 AM
Last Post: BashBedlam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020