Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

q1 Considering the text is given below, a) Count the total words of each paragraph and total words of the text and print it on

q1 Considering the text is given below,

a) Count the total words of each paragraph and total words of the text and print it on the screen.

b) Find the longest word of each paragraph and print on the screen.

c) Check if each paragraph contains lorem and ipsum words. If so, find the index number(s). If there are more than one of these words, count them for each paragraph and print on the screen.

d) Remove all lorem and ipsum words from the text and write XXX inside. Here, pay attention the uppercase and lowercase letters.

e) Get the name, surname and student ID of the user and add these values at the end of the text as separate variables (name, surname, ID) and print.

Lorem Ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam interdum, nibh ut auctor sollicitudin, nibh ante vestibulum purus, eget imperdiet ante ligula sed nisi. Duis nisl nulla, ornare ut leo nec, pellentesque iaculis ex. Duis id nisl aliquam, condimentum nunc sed, lacinia elit. Phasellus feugiat dui urna, egestas malesuada leo maximus at. Integer justo nisl, congue nec porta eget, euismod a est. Duis ultrices sem tortor, id pulvinar augue tincidunt in. Nam semper non nibh vel pharetra. Curabitur quis magna a elit varius porttitor a ac augue. Duis rhoncus ultricies lacinia. Mauris nec lorem ornare, accumsan eros et, convallis quam. Nunc auctor orci sit amet iaculis tristique. Nullam in purus purus. Pellentesque ultricies augue tortor, vel faucibus mi condimentum vel. Etiam nec congue nibh, vel rutrum sem. Donec quis dolor nec tortor pulvinar lacinia et in tellus. Praesent efficitur tortor eros, eu tempor felis molestie sit amet. Phasellus maximus a massa non consectetur. Morbi eu ligula rhoncus, blandit odio eu, finibus dolor. In hac habitasse platea dictumst. Vivamus efficitur urna eu nulla luctus fringilla. Praesent tincidunt justo a est consequat blandit. Sed porta elit et sapien ultricies, lobortis placerat nisi laoreet. Pellentesque consectetur interdum fringilla. Mauris in elit nec erat porttitor egestas non at quam. Curabitur mattis ac lectus nec ornare. Etiam consectetur libero lacinia orci venenatis convallis. Vivamus a suscipit ante, et sagittis tellus. Vestibulum sed sagittis ex, laoreet iaculis risus. Donec eget massa sed neque suscipit faucibus. Pellentesque ac velit id velit varius scelerisque. Suspendisse vulputate, lorem eu pretium interdum, enim mauris laoreet ipsum, non elementum arcu risus vitae est. Sed vel elementum erat, ut facilisis augue. Vestibulum dolor libero, luctus euismod finibus ut, sodales ac est. Sed accumsan bibendum leo non mattis. Pellentesque sit amet nibh porta, facilisis turpis a, ullamcorper lectus. Morbi vel ex velit. Phasellus maximus ultrices mattis. Aenean congue ornare erat vel efficitur. In cursus sit amet orci vitae imperdiet. Fusce elementum volutpat odio, id vulputate nunc condimentum non. Ut vel laoreet tortor, in sodales velit. Morbi at ipsum nunc. Etiam non enim ac justo porta eleifend nec at arcu. Integer tempus venenatis dolor condimentum consequat. Ut finibus tincidunt nibh, at feugiat justo eleifend vitae. Morbi malesuada semper odio at tincidunt. Quisque vulputate, dui et vehicula ornare, risus velit elementum enim, non iaculis urna mauris sit amet justo. Ut quis neque accumsan lectus facilisis blandit.

q2 Please write pyhton script that lists the total number of words and word frequencies in an entered text by user.

image text in transcribed

ALL ANSWERS ON PYTHON!!!

Sample Output: Please enter a text. An optional Format Specifier can follow the expression. Format Specifier can be used in print command. There are 16 words in the text FREQUENCY RESULTS : An ==> 1 optional ==> 1 Format ==> 2 Specifier ==> 2 can ==> 2 follow ==> 1 the ==> 1 expression. ==> 1 be ==> 1 used ==> 1 ==> 1 print ==> 1 command. ==> 1 in

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

Students also viewed these Databases questions