Attachment 'strshuf.py'

Download

   1 #!/usr/bin/python
   2 # -*- coding: utf-8 -*-
   3 
   4 '''Вводится строка, выводится та же строка со случайно перемешанными символами'''
   5 
   6 import random
   7 
   8 s=raw_input()
   9 l=list(s)
  10 random.shuffle(l)
  11 # предположим, что мы не знаем метода `join` :)
  12 t=""
  13 for c in l:
  14   t+=c
  15 print t

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.