logo

Implementation of Palindrome check from the words of the file

Automate a business process using Microsoft Excel and visualize the impact of the automation.

7 Pages531 Words1 Views
   

Added on  2022-12-26

About This Document

This document provides the implementation of a Palindrome check from the words of a file. It includes the pseudocode and code for the program, as well as an explanation of how to determine if a word is a Palindrome or not.

Implementation of Palindrome check from the words of the file

Automate a business process using Microsoft Excel and visualize the impact of the automation.

   Added on 2022-12-26

ShareRelated Documents
Running head: ITECH1400 FUNDAMENTALS OF PROGRAMMING
ITECH1400 Fundamentals of Programming
Name of the Student
Name of the University
Authors note
Implementation of Palindrome check from the words of the file_1
ITECH1400 FUNDAMENTALS OF PROGRAMMING
1
Implementation of Palindrome check from the words of the file
Pseudocode
Step 1: Read file
Step 2: Read all the words or strings in the file.
Step 3: Initialize len variable to zero and a flag= zero
Step 4: While word[len] is not NULL
len++
Initialize “k” to zero , l to len-1
While k < (len/2)+1
If word[i] =word[J]
flag=0
else
Flag=1
Increment i , l Decrement
If flag=0
Print Palindrome
else
Print Not Palindrome
Stop
Implementation of Palindrome check from the words of the file_2
ITECH1400 FUNDAMENTALS OF PROGRAMMING
2
Code
with open('English.txt') as text:
count=0
for line in text:
line = line.strip()
lines = line[::-1]
if line == lines:
count+=1
print ('Following line in the text file is a Palindrome!')
print(count)
print(line)
Implementation of Palindrome check from the words of the file_3

End of preview

Want to access all the pages? Upload your documents or become a member.