Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for Python, Thank you very much. (1) Create a list of the first 100 triangular numbers. The triangular numbers . You should use

image text in transcribedThis is for Python, Thank you very much.

(1) Create a list of the first 100 triangular numbers. The triangular numbers . You should use a for loop . are 1, 1+2, 1+2+3, 1+2+3+4, 1+2+3+4+5, where you explicitly calculate the addend. (2) Create a list of the first 100 pentagonal numbers. The pentagonal numbers are 1, 1+4, 1+4+7, 1+4+7+10, (3) Implement twice a function that tests whether a string is a palindrome, such as "able wasi ere i saw elba". One implementation should use the test for equality for strings, the other one should use comparison of individual characters. For the first one, you can generate the reverse string as a slice. (4) Implement a function minus (listA, listB) which returns a list of all elements in listA that are not in listB. (5) Implement a function that takes a string and replaces all consonants with a consonant+'y'+consonant combination. For example, "string" becomes "systytryrinyngyg

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

Explain the market segmentation.

Answered: 1 week ago

Question

Mention the bases on which consumer market can be segmented.

Answered: 1 week ago