## Friday, October 16, 2020

Solution Exercise 47: program python that determines the list of all the word with at least on upercase #### Exercise 47

Write a python program that determines the list of all the words which contains at least one uppercase character in a given text T. Example if T = "Python is a high level programming language. Originally developed by Guido van Rossum in 1989." The program returns the list:
``['Python', 'Originally', 'Guido', 'Rossum']``

#### Solution

``````# creating a function which test if given word contains at least one uppercase character
def testUpercase(s):
# initializing counter
counter = 0
for letter in s:
if letter.isupper():
counter = counter + 1
if counter > 0:
return True
else:
return False

T = "Python is  a high level programming language. Originally developed by Guido van Rossum in 1989."

# initializing the list of all the words which contains at least one uppercase character
listUpper = []

# transform the text T to a list
L = T.split()

for word in L:
if(testUpercase(word)):
listUpper.append(word)

# display the list
print(listUpper)
# The output is : ['Python', 'Originally', 'Guido', 'Rossum']``````

Younes Derfoufi
my-courses.net

## Python Exercises With Solutions

1. Python Arithmetic Exercises
2. Equations & System Of Equations
3. Polynomials and Functions
4. Python Arithmetic Exercises
5. Numpy, Matplolib, Sympy , Scipy - Exercises
6. Python Arithmetic Exercises

Younes Derfoufi

## Sample Text 