/
rnekrasov
/
Python
Обзор
Документация
Войти
/
rnekrasov
/
Python
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
replacetext.py
11 строк
324 B
Swastik Saha
Update replacetext.py
03 окт 2020, 10:04
Не верифицирован
03 окт 2020, 10:04
53b283d
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # program to replace all the spaces in an entered string with a hyphen"-" def replacetext(string): string = string.replace(" ", "-") return string S = input("Enter a text to replace all its spaces with hyphens: ") N = replacetext(S) print("The changed text is: ", N)