12camtheman
07.06.2021 •
Computers and Technology
Modify a list Modify short_names by deleting the first element and changing the last element to Joe. Sample output with input: 'Gertrude Sam Ann Joseph' ["Sam', 'Ann', 'Joe'l 1 user_input = input() 2 short names = user input.split() 3 short_names - short_names.pop(0) 6 print (short_names) based
Solved
Show answers
More tips
- S Society and Politics Why are thugs called gopniks ? A fascinating journey through Russian subculture...
- A Animals and plants Want a Perfect Lawn? Learn How to Plant Grass the Right Way...
- A Animals and plants How to Properly Care for a Pet Decorative Rabbit at Home?...
- C Computers and Internet How to Check the Speed of My Internet?...
- H Health and Medicine 10 Ways to Cleanse Your Colon and Improve Your Health...
- W Work and Career How to Write a Resume That Catches the Employer s Attention?...
- C Computers and Internet Е-head: How it Simplifies Life for Users?...
- F Family and Home How to Choose the Best Diapers for Your Baby?...
- F Family and Home Parquet or laminate, which is better?...
- L Leisure and Entertainment How to Properly Wind Fishing Line onto a Reel?...
Answers on questions: Computers and Technology
- M Mathematics Cite tres pares de nuneros que estén en la relación. de 3 y 5...
- M Mathematics PLEASE HELP! WILL GIVE BRAINLIEST!Solve for x...
- M Mathematics Please help with this assignment...
- H History 1st one Loyalty Belief Harmony Heresy 2nd one Medieval inquisition Council of Trent Roman inquisition Spanish Inquisition...
- M Mathematics A little help? the question is attached...
- M Mathematics A) describe each two-dimensional figure cross section that results from slicing each three-dimensional figure B)describe the two dimensional figure cross section that results from...
- M Mathematics Jim read a total of 240 pages over 10 hours. In all, how many hours of reading will Jim have to do this week in order to have read a total of 888 pages? Assume the relationship...
- B Business A nice way about that day was not an opportunity and will have an opportunity and will send it to my knowledge and experience the most important is a bit about my parents had their...
- E English Which of the following is the best synonym for siege ? A relief B. peace C. beleaguer D. conciliation...
- M Mathematics Here are free points, enjoy your day! stay safe and stay happy. ENJOY lol...
Ответ:
The modified program is as follows:
user_input = input()
short_names = list(user_input.split(" "))
short_names.pop(0)
short_names[-1] = "Joe"
print(short_names)
Explanation:
This gets the user input
user_input = input()
This converts input to list
short_names = list(user_input.split(" "))
This removes the first item of the list
short_names.pop(0)
This updates the last item to "Joe"
short_names[-1] = "Joe"
This prints the updated list
print(short_names)
Ответ: