Computer Science, asked by upendra4069, 5 months ago

use python and Write a program to check if the letter 'e' is present in the word 'Umbrella'?

Answers

Answered by anindyaadhikari13
4

Question:-

  • Write a program to check if letter 'e' is present in the word "Umbrella"

Program:-

This is written in Python.

if 'e' in "Umbrella":

print ("Present.")

else:

print("Not Present.")

For verification, check out the attachment.

Attachments:
Answered by ishwaryam062001
0

Answer:

Python program to check if the letter 'e' is present in the word 'Umbrella'

Explanation:

From the above question,

We have to write  a python program to check if the letter 'e' is present in the word 'Umbrella'

RegEx can be used to test if a string includes the special search pattern. Python has a built-in bundle referred to as re, which can be used to work with Regular Expressions.

# When you have imported the re module,

# you can start using regular expressions.

import re

# Take input from users

S1 = "UMBERLLA"

S2 = "A"

# re.search() returns a Match object

# if there is a match anywhere in the string

if re.search(S2, S1):

   print("YES,string '{0}' is present in string '{1}'" .format(

       S2, S1))

else:

   print("NO,string '{0}' is not present in string '{1}' " .format(

       S2, S1))

For more such related questions : https://brainly.in/question/32667309

#SPJ2

Similar questions