|
861 | 861 | },
|
862 | 862 | {
|
863 | 863 | "cell_type": "code",
|
864 |
| - "execution_count": null, |
| 864 | + "execution_count": 81, |
865 | 865 | "id": "3803355b",
|
866 | 866 | "metadata": {},
|
| 867 | + "outputs": [ |
| 868 | + { |
| 869 | + "data": { |
| 870 | + "text/plain": [ |
| 871 | + "'h:\\\\Python\\\\practice_python'" |
| 872 | + ] |
| 873 | + }, |
| 874 | + "execution_count": 81, |
| 875 | + "metadata": {}, |
| 876 | + "output_type": "execute_result" |
| 877 | + } |
| 878 | + ], |
| 879 | + "source": [ |
| 880 | + "os.getcwd()" |
| 881 | + ] |
| 882 | + }, |
| 883 | + { |
| 884 | + "cell_type": "code", |
| 885 | + "execution_count": 83, |
| 886 | + "id": "20ddeb0f", |
| 887 | + "metadata": {}, |
| 888 | + "outputs": [ |
| 889 | + { |
| 890 | + "data": { |
| 891 | + "text/plain": [ |
| 892 | + "['.git',\n", |
| 893 | + " '.ipynb_checkpoints',\n", |
| 894 | + " '1st.txt',\n", |
| 895 | + " 'anchor_tag.html',\n", |
| 896 | + " 'Anonymous_Function.ipynb',\n", |
| 897 | + " 'basic_code.html',\n", |
| 898 | + " 'collection_practice.ipynb',\n", |
| 899 | + " 'datatype.ipynb',\n", |
| 900 | + " 'demo.html',\n", |
| 901 | + " 'desktop.ini',\n", |
| 902 | + " 'driving_lic.ipynb',\n", |
| 903 | + " 'find lenth of string.ipynb',\n", |
| 904 | + " 'find_biggest_number.ipynb',\n", |
| 905 | + " 'find_factorial.ipynb',\n", |
| 906 | + " 'function _type.ipynb',\n", |
| 907 | + " 'functions.ipynb',\n", |
| 908 | + " 'function_practice.ipynb',\n", |
| 909 | + " 'function_with_parameters.ipynb',\n", |
| 910 | + " 'heading.html',\n", |
| 911 | + " 'heart.ipynb',\n", |
| 912 | + " 'if_else.ipynb',\n", |
| 913 | + " 'keyword_arguments_function.ipynb',\n", |
| 914 | + " 'list_method_practice.ipynb',\n", |
| 915 | + " 'loops_control_statement.ipynb',\n", |
| 916 | + " 'module_practice.ipynb',\n", |
| 917 | + " 'odd_even_number.ipynb',\n", |
| 918 | + " 'positive_negative_value.ipynb',\n", |
| 919 | + " 'practice_dict.ipynb',\n", |
| 920 | + " 'practice_for_assignment.ipynb',\n", |
| 921 | + " 'practice_for_solve_problem.ipynb',\n", |
| 922 | + " 'Readme.md',\n", |
| 923 | + " 'set.ipynb',\n", |
| 924 | + " 'set_method_practice.ipynb',\n", |
| 925 | + " 'set_operations.ipynb',\n", |
| 926 | + " 'slicing.ipynb',\n", |
| 927 | + " 'something.ipynb',\n", |
| 928 | + " 'Student_data.ipynb',\n", |
| 929 | + " 'turtle.ipynb',\n", |
| 930 | + " 'without_parameters_function.ipynb']" |
| 931 | + ] |
| 932 | + }, |
| 933 | + "execution_count": 83, |
| 934 | + "metadata": {}, |
| 935 | + "output_type": "execute_result" |
| 936 | + } |
| 937 | + ], |
| 938 | + "source": [ |
| 939 | + "os.listdir(os.getcwd())" |
| 940 | + ] |
| 941 | + }, |
| 942 | + { |
| 943 | + "cell_type": "code", |
| 944 | + "execution_count": 84, |
| 945 | + "id": "f57dfb03", |
| 946 | + "metadata": {}, |
| 947 | + "outputs": [ |
| 948 | + { |
| 949 | + "ename": "TypeError", |
| 950 | + "evalue": "'builtin_function_or_method' object is not iterable", |
| 951 | + "output_type": "error", |
| 952 | + "traceback": [ |
| 953 | + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", |
| 954 | + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", |
| 955 | + "\u001b[1;32mh:\\Python\\practice_python\\module_practice.ipynb Cell 48\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> <a href='vscode-notebook-cell:/h%3A/Python/practice_python/module_practice.ipynb#X65sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mfor\u001b[39;00m i \u001b[39min\u001b[39;00m os\u001b[39m.\u001b[39mlistdir:\n\u001b[0;32m <a href='vscode-notebook-cell:/h%3A/Python/practice_python/module_practice.ipynb#X65sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m \u001b[39mif\u001b[39;00m i\u001b[39m==\u001b[39misdir():\n\u001b[0;32m <a href='vscode-notebook-cell:/h%3A/Python/practice_python/module_practice.ipynb#X65sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39m'\u001b[39m\u001b[39mhello\u001b[39m\u001b[39m'\u001b[39m)\n", |
| 956 | + "\u001b[1;31mTypeError\u001b[0m: 'builtin_function_or_method' object is not iterable" |
| 957 | + ] |
| 958 | + } |
| 959 | + ], |
| 960 | + "source": [ |
| 961 | + "for i in os.listdir:\n", |
| 962 | + " if i==isdir():\n", |
| 963 | + " print('hello')" |
| 964 | + ] |
| 965 | + }, |
| 966 | + { |
| 967 | + "cell_type": "code", |
| 968 | + "execution_count": null, |
| 969 | + "id": "77e7a1bb", |
| 970 | + "metadata": {}, |
867 | 971 | "outputs": [],
|
868 | 972 | "source": []
|
869 | 973 | }
|
|
0 commit comments