Первый код на Python. И это не HelloWorld!
Первый код на Python.
Опубликовано
python Первый код на Python. И это не HelloWorld!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
print()
txt = input("Текст: ")
res = list(txt.upper())
def first(target):
return target[0]
def last(target):
return target[-1]
def replace_chars():
res.append(first(res))
res.remove(last(res))
def decrease_chars():
del res[-1]
print()
for i in range(len(res)):
print (' '.join(res))
replace_chars()
print()
|