Member Avatar for talat.zaitoun

I'm trying to make a program that scrambles the order of sentences. The program must take an input file and scramble it into an output file however, when the sentences are scrambled, they should be numbered according to their original order. For example,

I love apples --------> 2. I love candy
I love candy --------> 3. I love God
I love God --------> 1. I love apples

I'm really not sure how to begin, so if you can provide me with ideas or a way to approach this problem or what functions and methods i should be using then that would be very great. Thank you.

Recommended Answers

All 2 Replies

Member Avatar for talat.zaitoun

I love apples --------> 2:I love candy
I love candy --------> 3:I love God
I love God --------> 1:I love apples

I apologize but the sentences are supposed to be numbered like this with no spaces

Use enumerate and random.shuffle.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.