Can this Python sentence randomizer code by any shorter?
Is it possible to make this Python code any shorter than it already is?
import random
words = list(input("Enter a sentence to randomize: ").split(" "))
for i in range(len(words)):
print(end = words[random.randint(1,len(words)-1)] + " ")
Aucun commentaire:
Enregistrer un commentaire