USING PYTHON 2 2-Write a function named firstUse() that identifies the first use
ID: 3803366 • Letter: U
Question
USING PYTHON 2
2-Write a function named firstUse() that identifies the first use of words longer than four letters and put those first ocurrences in all caps. input: a string that contains space delimited words, output: the input string: with the first use of each word longer than four letters in all caps hint: use index and upper
problem 3-write a function named mostCommonWord() that takes a space delimited text as a parameter and return the most common word(not counting the articles 'a','an' and 'the') in a text hint: use the method count,
Explanation / Answer
ln = raw_input("Enter words separated by spaces:")
ln = ln.split()
kh = []
for a in ln:
if a not in kh:
if len(a)>=4:
print a.upper()
kh.append(a)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.