## Monday, September 2, 2019

Solution Exercise 26-word beginnig with a letter a in python

#### Exercise 26

Write a program that asks the user to enter a text and return all words beginning with the letter a.

### First method

``````# Ask to type a string text
s = input("Type a string text : ")
# convert a string s to list
s = s.split()
# fetching all list element that beginning with the letter 'a'
for x in s:
if(x == 'a'):
print("The word : ", x, " begin with the letter 'a'")
``````

### Second method

``````# Ask to type a string text
s = input("Type a string text : ")
# convert a string s to list
s = s.split()

# Getting the len of list s
n = len(s)

# fetching all list element that beginning with the letter 'a'
for i in range(0,n):
if(s[i] == 'a'):
print("The word : '", s[i], "' begin with the letter 'a'")
"""
Example of execution : if you type "Me and you are beginner"
You will receive the message :
The word : 'and' begin with the letter 'a'
The word : 'are' begin with the letter 'a'
"""
``````

Younes Derfoufi

## 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 