SHARE
TWEET

Challenge

a guest Sep 22nd, 2019 89 in 5 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def str_child1(question='Enter a word ', number_of_times=2):
  2.     response=[]
  3.     for i in range(number_of_times):
  4.         while True:
  5.             word=input(question)
  6.             if word and word.isalpha():
  7.                 new_word=word.upper()
  8.                 response.append(new_word)
  9.                 break
  10.             else:
  11.                 print('Incorrect Input.Try Again')
  12.     a,b=response
  13.     form1= set([*a])
  14.     form2= set([*b])
  15.     in_both= sorted(list(sorted(form1.intersection(form2))))
  16.     result1=''.join(in_both)
  17.     result2= [len(result1), result1]
  18.     print(result2)
  19.  
  20. str_child1()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top