Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone help me with this in python, they are essentially the same question that is why I put them together. For the following six

can someone help me with this in python, they are essentially the same question that is why I put them together.

image text in transcribedimage text in transcribed

For the following six questions, assume that the variable data refers to the list [10, 20, 30] 1) The expression data[1] evaluates to: 2) The expression data (1:3) evaluate to: 3) The expression data.index(20) evaluates to: 4) The expression data + [40, 50) evaluates to: 5) After the statement data[1] = 5, data evaluates to: 6) After the statement data.insert(1,15), the original data evaluates to: Problem3: Get a sequence from user and count the number of times each character is repeated, and the size the string itself. Also, store all the characters and their counts in a list as pairs. A sample output: please input your message: books are goooood! There are 18 characters in total 90 HOU- ('a', 1), [('b', 1), ('o', 7), ('k', 1), ('s', 1), ('', 2), ('r', 1), ('e', 1), ('g', 1), ('d', 1), ('!', 1)] Problem4: Write a Python program that prompts the user to enter a list of words (-1 to quit) and stores in a list only those words whose first letter occurs again within the word (for example, 'Baboon'). The program should display the resulting list. A sample output: enter a word: tom enter a word: Baboon enter a word: Book enter a word: Bob enter a word: -1 ['Baboon', 'Bob'] For the following six questions, assume that the variable data refers to the list [10, 20, 30] 1) The expression data[1] evaluates to: 2) The expression data (1:3) evaluate to: 3) The expression data.index(20) evaluates to: 4) The expression data + [40, 50) evaluates to: 5) After the statement data[1] = 5, data evaluates to: 6) After the statement data.insert(1,15), the original data evaluates to: Problem3: Get a sequence from user and count the number of times each character is repeated, and the size the string itself. Also, store all the characters and their counts in a list as pairs. A sample output: please input your message: books are goooood! There are 18 characters in total 90 HOU- ('a', 1), [('b', 1), ('o', 7), ('k', 1), ('s', 1), ('', 2), ('r', 1), ('e', 1), ('g', 1), ('d', 1), ('!', 1)] Problem4: Write a Python program that prompts the user to enter a list of words (-1 to quit) and stores in a list only those words whose first letter occurs again within the word (for example, 'Baboon'). The program should display the resulting list. A sample output: enter a word: tom enter a word: Baboon enter a word: Book enter a word: Bob enter a word: -1 ['Baboon', 'Bob']

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

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions

Question

7. Set team as well as individual performance goals.

Answered: 1 week ago

Question

What steps should be taken to address any undesirable phenomena?

Answered: 1 week ago