{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'PYTHON'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"python\".upper()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'python'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"PYTHON\".lower()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'PYTHON'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"PytHon\".upper()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'python'" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"PytHon\".lower()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Herkes ono bobo bocı gordoş'" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"Herkes ana baba bacı gardaş\".replace(\"a\",\"o\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Python-Programlama-Dili'" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"Python Programlama Dili\".replace(\" \",\"-\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Kunzun'" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"Kunduz\".replace(\"duz\",\"zun\")" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"Python\".startswith(\"p\")" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"Python\".startswith(\"P\")" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"Python\".endswith(\"on\")" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"Python\".endswith(\"an\")" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "collapsed": true }, "outputs": [], "source": [ "liste = \"Python Programlama Dili\".split(\" \")" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['Python', 'Programlama', 'Dili']\n" ] } ], "source": [ "print(liste)" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "collapsed": true }, "outputs": [], "source": [ "liste2 = \"Python-Php-Javascript-C-Java\".split(\"-\")" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['Python', 'Php', 'Javascript', 'C', 'Java']\n" ] } ], "source": [ "print(liste2)" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'python'" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\" python \".strip()" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'python '" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\" python \".lstrip()" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "' python'" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\" python \".rstrip()" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Python'" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Python>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\".strip(\">\")" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'21/02/2014'" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "liste = [\"21\",\"02\",\"2014\"]\n", "\n", "\"/\".join(liste)" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'T.B.M.M'" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "liste2 = [\"T\",\"B\",\"M\",\"M\"]\n", "\n", "\".\".join(liste2)" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "6" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"ada kapısı yandan çarklı\".count(\"a\")" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"ada kapısı yandan çarklı\".count(\" \")" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"ada kapısı yandan çarklı\".count(\"a\",2)" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"araba\".find(\"a\")" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"araba\".rfind(\"a\")" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-1" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"araba\".find(\"s\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }