├── .idea ├── .gitignore ├── New Folder.iml ├── inspectionProfiles │ └── profiles_settings.xml ├── misc.xml └── modules.xml ├── a.txt ├── k.txt ├── problem.py ├── problem1.py ├── problem2.py ├── problem3.py ├── problem4.py └── txt.txt /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/New Folder.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /a.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akramjon009/python/21815159fdf86e6f0cdd4275591e95105793ce38/a.txt -------------------------------------------------------------------------------- /k.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akramjon009/python/21815159fdf86e6f0cdd4275591e95105793ce38/k.txt -------------------------------------------------------------------------------- /problem.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akramjon009/python/21815159fdf86e6f0cdd4275591e95105793ce38/problem.py -------------------------------------------------------------------------------- /problem1.py: -------------------------------------------------------------------------------- 1 | text = input('soz kiriting ') 2 | harf = input('harif kiriting ') 3 | count = 0 4 | for i in range(len(text)): 5 | if text[i] == harf: 6 | count += 1 7 | if count == 2: 8 | print(i) 9 | break -------------------------------------------------------------------------------- /problem2.py: -------------------------------------------------------------------------------- 1 | try: 2 | lis = list(input('son kiriting ')) 3 | sets = list(set(lis)) 4 | print(str(lis) - str(sets)) 5 | except TypeError: 6 | print('error') 7 | exec(1) 8 | else: 9 | print('e') 10 | -------------------------------------------------------------------------------- /problem3.py: -------------------------------------------------------------------------------- 1 | num = str() 2 | while True: 3 | n = input('son kiriting ') 4 | if n != 'c': 5 | num += n 6 | else: 7 | break 8 | print(sum(num)) -------------------------------------------------------------------------------- /problem4.py: -------------------------------------------------------------------------------- 1 | with open('txt.txt', 'r') as h: 2 | n = h.read().split(' ') 3 | print(n) 4 | for i in n: 5 | if 'a' in str(n).lower(): 6 | with open('a.txt', 'a') as a: 7 | a.write(i + ' ') 8 | if 'k' in str(n).lower(): 9 | with open('k.txt', 'a') as k: 10 | k.write(i + ' ') -------------------------------------------------------------------------------- /txt.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Akramjon009/python/21815159fdf86e6f0cdd4275591e95105793ce38/txt.txt --------------------------------------------------------------------------------