Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Name: #define function listcopy (sourceList) hain() Coding Exercise 04 Note: You will not be able to copy most of the code in this exercise. You

image text in transcribed

Name: #define function listcopy (sourceList) hain() Coding Exercise 04 Note: You will not be able to copy most of the code in this exercise. You have to type it Add ain() function and an entry point for your program. # In the main create a list named list and print(listi) # create another list list2 = listcopy (listl) and print list2 stest 1. Create a python file funcs.py and add a function point message that prints a message. Inputs are name and message to output. When name = "Luke' and message = "Good morning the output will be "Good morning Luke Below is the template for function:- det print message (name, message)! #remove the line below and add code to print message per instructions 3. Create a python file sentence.py and a function named crange Sentence that has an input of a string. The function will the following Accept a paragraph of text consisting of sentences that are terminated by either * (Full stop), T Exclamation mark) or a "? (Question mark). Assume that there can be maximum 10 sentences in a paragraph. Write a program to arrange the sentences in increasing order of their number of words. Update poot message function and make the message parameter default to "Good evening Example 1: Test above function with following inputs:- INPUT: Please come and attend the party. Hello! How are you? OUTPUT: Hello = 1 How are you = 3 Please come and attend the party = 6 print_message('Jasmine Example 2: print message (Joy', "Good night) print_message (messageWelcome', name' Peter) INPUT: I am looking for the best programmer! Can you code in python? Is python fun? My two cents. OUTPUT Run code and capture results using a screen shot. Upload results and code file. 2. Create a python file list_copy.py and add define function named listcopy(sourceList) Write code to create an empty list named retlist loop through the items in source list and appending retlist. The function should return vetlist My two cents = 3 Is python fun = 3 Can you code in python = 5 I am looking for the best programmer = 7 Example det ArrangeSentence sentence) Add a main function and an entry point for your program. In the main create a list named list and print(list), create list2 = listopx (list) and print list2. Testif both lists are equal read sentence ArrangeSentence(a)

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

Students also viewed these Databases questions