Write a section of code that asks the user for their last name and then will create A new string produced by randomly splitting their name into two parts and reversing their order.
Example: "computer" may produce the result "utter comp".

Answers

Answer 1

import random

name = input("Enter your last name: ")

w = random.randint(0,len(name)-1)

txt = name[0:w]

txt1 = name[w:]

print(txt1+" "+txt)

I hope this helps!


Related Questions

what are output devices ?
name them​

Answers

Answer:

Monitor.

Printer.

Headphones.

Computer Speakers.

Projector.

GPS.

Sound Card.

Video Card.

Explanation:

Other Questions
1. At the beginning of the year, Maria had $100 in her savings account. She plans to spend $10 amonth on a music app. By the end of January, she will have $90, 580 by the end of February,$70 by the end of March, and so on. Write an equation that describes the amount in her savingsat any given month. Be sure to describe what your variables represent. What is the superhero gloves mostly about? Select the statements that describe how the disciples acted after they were baptized with the Holy Spirit:full of faithbashful about sharing their beliefsspoke boldly about Christ to the Jewish councilhid behind locked doors for fear of the Jewish rulersbold in proclaiming Jesus' death, burial, and resurrection. Please HelpPlease let me know how to do it, I don't only want the answer. Thank you!(4y+3)-(y-2)(There is no equal sign in the math problem) Which property should be used next in this solution process?3x + 2 + 3 = 7(x - 1) 43x + 5 = 7(x - 1) 4A. Commutative Property of AdditionB. Identity Property of MultiplicationC. Associative Property of MultiplicationD.Distributive Property Disney just launched Disney+ last year and is called one of the best streaming apps available. If you could develop an app, what would it be? How would it work? Who would use it? What are the zeros of this function what point does the author make in telling of Jurgis's political work. Juan makes an adjustment to an electromagnet that causes the electromagnet to lose some of its strength. What did Juan most likely do?He reduced the number of loops in the wire.He increased the number of loops in the wire.He reduced the length of the wire.He increased the length of the wire. Obtaining nutrients from theenvironment and breaking them downfor transport...a.Synthsisb.Nutritionc. Transportd.Simple Sugars Proposition 16: Allows Diversity as a Factor in Public Employment, Education, and Contracting Decisions. Legislative Constitutional Amendment.YES OR NO Why is an important to come up with a plan for how are you to respond to negative peer pressure before the situation happensA: it is hard to refuse in the situation if you have not decided how you would handle it ahead of timeB: because it is very likely you will face these situation in the futureC: both a and b z = 24a - 2bsolve for a christianity true or false If the cultural value celebrated in this passage is the pride men take in their sons, which quotation from the passage wouldmost likely support that cultural value interpretation?A)"He will be christened Paul, my-Mrs Dombey-of course."B)CD"The earth was made for Dombey and Son to trade in, and the sun andmoon were made to give them light.""A transient flush of faint surprise overspread the sick lady's face asshe raised her eyes towards him.""She feebly echoed, "Of course," or rather expressed it by the motionof her lips, and closed her eyes again."D) Feeling Gratiude and not expreesing it is wrapping is wrapping a present and not giving it what does the quote mean in your words 32a + 28 = 0(Factor completely.) I need help with this Reflect and RespondHammurabi's Code gave different punishments to offenders, depending on which class theybelonged to. Why do you think the law was set up this way? In 1526, Spain made Cortes viceroyalty or viceroy of Nueva Espana. This put all lands directly under the __________. A.) kingB.) emperorC.) president D.)governor