Answered step by step
Verified Expert Solution
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
This 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 "systytryrinyngygStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started