Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Given list of strings, write a script to count the number of strings that the string length is 3 or more and the

1. Given list of strings, write a script to count the number of strings that the string length is 3 or more and the first and last characters are the same. For example, a list of [cbc,123,ww,abc,strings] will have a result of 2(cbc and strings).
2. Given a list of numbers, i.e.,[23,45,12,123,98,76], write a script to find the largest number and its position in the list. It would be the 4th element and the value is 123 in the example above.
3. Given a list of numbers of strings, find whether there are two or more numbers/strings match (having the same value). For example, [12,34,56,78] has no match while ["GIS", "script", "Programming", "Python", "GIS"] has a match.
4.(Optional) We have 18 students in the class, simulate the chance that there are students with the same birthday (the same day, not the year) assuming 365 days a year. this is an expansion of #3.(Hint: 1) generating 18 random numbers in the range between 1 and 365 and find if there is a match; 2) repeating the process many times (the more times you repeat, the more accurate your result is) and count how many times there is a match.

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

=+ 9. What is inflation and what causes it?

Answered: 1 week ago

Question

=+6. What does the invisible hand of the marketplace do?

Answered: 1 week ago