{"id":963,"date":"2021-07-09T08:19:19","date_gmt":"2021-07-09T08:19:19","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=963"},"modified":"2021-07-09T08:19:20","modified_gmt":"2021-07-09T08:19:20","slug":"osnovnye-metody-strok","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/uk\/osnovnye-metody-strok\/","title":{"rendered":"\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u0442\u0440\u043e\u043a"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>isalpha()<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432<\/li><li><strong>islower()<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435<\/li><li><strong>isupper()<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435<\/li><li><strong>isdigit()<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0441\u0442\u0440\u043e\u043a\u0438 &#8211; \u0446\u0438\u0444\u0440\u044b<\/li><li><strong>isnumeric()<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0447\u0438\u0441\u043b\u043e<\/li><li><strong>startswith(str)<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 str<\/li><li><strong>endswith(str)<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443 str<\/li><li><strong>lower()<\/strong>: \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043d\u0438\u0436\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440<\/li><li><strong>upper()<\/strong>: \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0432\u0435\u0445\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440<\/li><li><strong>title()<\/strong>: \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432\u0441\u0435\u0445 \u0441\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440<\/li><li><strong>capitalize()<\/strong>: \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0432 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043f\u0435\u0440\u0432\u0443\u044e \u0431\u0443\u043a\u0432\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0441\u0442\u0440\u043e\u043a\u0438<\/li><li><strong>lstrip()<\/strong>: \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438<\/li><li><strong>rstrip()<\/strong>: \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438<\/li><li><strong>strip()<\/strong>: \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438<\/li><li><strong>ljust(width)<\/strong>: \u0435\u0441\u043b\u0438 \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 width, \u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u0435\u043b\u044b, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 width, \u0430 \u0441\u0430\u043c\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e<\/li><li><strong>rjust(width)<\/strong>: \u0435\u0441\u043b\u0438 \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 width, \u0442\u043e \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u0435\u043b\u044b, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 width, \u0430 \u0441\u0430\u043c\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u0440\u0430\u044e<\/li><li><strong>center(width)<\/strong>: \u0435\u0441\u043b\u0438 \u0434\u043b\u0438\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 width, \u0442\u043e \u0441\u043b\u0435\u0432\u0430 \u0438 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u0435\u043b\u044b, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 width, \u0430 \u0441\u0430\u043c\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443<\/li><li><strong>find(str[, start [, end])<\/strong>: \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435. \u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e -1<\/li><li><strong>replace(old, new[, num])<\/strong>: \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043e\u0434\u043d\u0443 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e<\/li><li><strong>split([delimeter[, num]])<\/strong>: \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f<\/li><li><strong>join(strs)<\/strong>: \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443, \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0432\u0432\u043e\u0434 \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b \u0447\u0438\u0441\u043b\u0430, \u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 isnumeric() \u0432\u0432\u0435\u0434\u0435\u043d\u043e \u043b\u0438 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u043e, \u0438 \u0435\u0441\u043b\u0438 \u0442\u0430\u043a, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<\/td><td><code>string =<\/code> <code>input(\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0447\u0438\u0441\u043b\u043e: \")<\/code><br><code>if<\/code> <code>string.isnumeric():<\/code><br><code>number =<\/code> <code>int(string)<\/code><br><code>print(number)<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u043e\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<\/td><td><code>file_name =<\/code> <code>\"hello.py\"<\/code><br>\u00a0<code>starts_with_hello =<\/code> <code>file_name.startswith(\"hello\")\u00a0\u00a0<\/code><br><code> # Trueends_with_exe =<\/code> <code>file_name.endswith(\"exe\")\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><br><code>\u00a0\u00a0 # False<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<\/td><td><code>string =<\/code> <code>\"\u00a0\u00a0 hello\u00a0 world!<\/code><br><code>\u00a0 \"string =<\/code> <code>string.strip()<\/code><br><code>print(string)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # hello\u00a0 world!<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438 \u0438 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<\/td><td><code>print(\"iPhone 7:\", \"52000\".rjust(10))<\/code><br><code>print(\"Huawei P10:\", \"36000\".rjust(10))<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">iPhone 7:      52000\nHuawei P10:      36000\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u041f\u043e\u0438\u0441\u043a \u0432 \u0441\u0442\u0440\u043e\u043a\u0435<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432 Python \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>find()<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0438\u043c\u0435\u0435\u0442 \u0442\u0440\u0438 \u0444\u043e\u0440\u043c\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>find(str)<\/code>: \u043f\u043e\u0438\u0441\u043a \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 str \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043e \u0435\u0435 \u043a\u043e\u043d\u0446\u0430<\/li><li><code>find(str, start)<\/code>: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 start \u0437\u0430\u0434\u0430\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0438\u0441\u043a<\/li><li><code>find(str, start, end)<\/code>: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 end \u0437\u0430\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u0434\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u043f\u043e\u0438\u0441\u043a<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430, \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 -1:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<\/td><td><code>welcome =<\/code> <code>\"Hello world! Goodbye world!\"<\/code><br><code>index =<\/code> <code>welcome.find(\"wor\")<\/code><br><br><code>print(index)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # 6<\/code><br>\u00a0<code># \u043f\u043e\u0438\u0441\u043a \u0441 10-\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430<\/code><br><code>index =<\/code> <code>welcome.find(\"wor\",10)<\/code><br><code>print(index)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # 21<\/code><br><br>\u00a0<code># \u043f\u043e\u0438\u0441\u043a \u0441 10 \u043f\u043e 15 \u0438\u043d\u0434\u0435\u043a\u0441<\/code><br><code>index =<\/code> <code>welcome.find(\"wor\",10,15)<\/code><br><code>print(index)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # -1<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u0417\u0430\u043c\u0435\u043d\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0437\u0430\u043c\u0435\u043d\u044b \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>replace()<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>replace(old, new)<\/code>: \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443 old \u043d\u0430 new<\/li><li><code>replace(old, new, num)<\/code>: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 num \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 old \u043d\u0430\u0434\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 new<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<\/td><td><code>phone =<\/code> <code>\"+1-234-567-89-10\"<\/code>\u00a0<br><code># \u0437\u0430\u043c\u0435\u043d\u0430 \u0434\u0435\u0444\u0438\u0441\u043e\u0432 \u043d\u0430 \u043f\u0440\u043e\u0431\u0435\u043be<\/code><br><code>dited_phone =<\/code> <code>phone.replace(\"-\", \" \")<\/code><br><code>print(edited_phone)\u00a0\u00a0\u00a0\u00a0<\/code><br><code> # +1 234 567 89 10<\/code>\u00a0<br><code># \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0444\u0438\u0441\u043e\u0432e<\/code><br><code>dited_phone =<\/code> <code>phone.replace(\"-\", \"\")<\/code><br><code>print(edited_phone)\u00a0\u00a0\u00a0\u00a0<\/code><br><code> # +12345678910<\/code><br>\u00a0<code># \u0437\u0430\u043c\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u0435\u0444\u0438\u0441\u0430e<\/code><br><code>dited_phone =<\/code> <code>phone.replace(\"-\", \"\", 1)<\/code><br><code>print(edited_phone)\u00a0\u00a0\u00a0\u00a0<\/code><br><code> # +1234-567-89-10<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u0420\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u043e\u0434&nbsp;<strong>split()<\/strong>&nbsp;\u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u043e\u0440\u043c\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>split()<\/code>: \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u0435\u043b<\/li><li><code>split(delimeter)<\/code>: \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f delimeter<\/li><li><code>split(delimeter, num)<\/code>: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 num \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 delimeter \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u041e\u0441\u0442\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0435\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<\/td><td><code>text =<\/code> <code>\"\u042d\u0442\u043e \u0431\u044b\u043b \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439, \u0432 \u0434\u0432\u0430 \u043e\u0431\u0445\u0432\u0430\u0442\u0430 \u0434\u0443\u0431, \u0441 \u043e\u0431\u043b\u043e\u043c\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u0442\u0432\u044f\u043c\u0438 \u0438 \u0441 \u043e\u0431\u043b\u043e\u043c\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u0440\u043e\u0439\"<\/code><br><code># \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c<\/code><br><code>splitted_text =<\/code> <code>text.split()<\/code><br><code>print(splitted_text)<\/code><br><code>print(splitted_text[6])\u00a0\u00a0\u00a0\u00a0 # \u0434\u0443\u0431,<\/code><br>\u00a0<code># \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043f\u043e \u0437\u0430\u043f\u044f\u0442\u044b\u043csp<\/code><br><code>litted_text =<\/code> <code>text.split(\",\")<\/code><br><code>print(splitted_text)<\/code><br><code>print(splitted_text[1])\u00a0\u00a0\u00a0\u00a0<\/code><br><code> # \u0432 \u0434\u0432\u0430 \u043e\u0431\u0445\u0432\u0430\u0442\u0430 \u0434\u0443\u0431<\/code>\u00a0<br><code># \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u043f\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u044f\u0442\u0438 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043csp<\/code><br><code>litted_text =<\/code> <code>text.split(\" \", 5)<\/code><br><code>print(splitted_text)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><br><code> print(splitted_text[5])\u00a0\u00a0\u00a0\u00a0 <\/code><br><code># \u043e\u0431\u0445\u0432\u0430\u0442\u0430 \u0434\u0443\u0431, \u0441 \u043e\u0431\u043b\u043e\u043c\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u0442\u0432\u044f\u043c\u0438 \u0438 \u0441 \u043e\u0431\u043b\u043e\u043c\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u0440\u043e\u0439<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u0440\u0443\u0433\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>join()<\/strong>: \u043e\u043d \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0440\u043e\u043a. \u041f\u0440\u0438\u0447\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<\/td><td><code>words =<\/code> <code>[\"Let\", \"me\", \"speak\", \"from\", \"my\", \"heart\", \"in\", \"English\"]<\/code>\u00a0<br><code># \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c - \u043f\u0440\u043e\u0431\u0435\u043b<\/code><br><code>sentence =<\/code> <code>\" \".join(words)<\/code><br><code>print(sentence)\u00a0<\/code><br><code> # Let me speak from my heart in English<\/code>\u00a0<br><code># \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c - \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0435\u0440\u0442\u0430<\/code><br><code>sentence =<\/code> <code>\" | \".join(words)<\/code><br><code>print(sentence)\u00a0<\/code><br><code> # Let | me | speak | from | my | heart | in | English<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u043c\u0435\u0441\u0442\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 \u043c\u0435\u0442\u043e\u0434 join \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0442\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<\/td><td><code>word =<\/code> <code>\"hello\"joined_word =<\/code> <code>\"|\".join(word)<\/code><br><code>print(joined_word)\u00a0\u00a0\u00a0<\/code><br><code>\u00a0\u00a0 # h|e|l|l|o<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><ins><\/ins><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445: isalpha(): \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[76],"tags":[],"class_list":["post-963","page","type-page","status-publish","hentry","category-rukovodstvo-po-yazyku-programmirovaniya-python"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/comments?post=963"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/963\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/media?parent=963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/categories?post=963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/tags?post=963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}