Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

comprehension

# user data entered as name and phone number
user_data = "Elvis Presley 987-654-3210"
phone_number = [ x for x in user_data if x.isdigit()]

print(phone_number)
Source by www.pythonforbeginners.com #
 
PREVIOUS NEXT
Tagged: #comprehension
ADD COMMENT
Topic
Name
2+3 =