Форум программистов, компьютерный форум, киберфорум
Python для начинающих
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 5.00/3: Рейтинг темы: голосов - 3, средняя оценка - 5.00
0 / 0 / 0
Регистрация: 05.04.2021
Сообщений: 2

Исправить ошибки в коде

26.04.2021, 17:55. Показов 671. Ответов 3
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
нужно исправить ошибки в коде
Python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
class AirCastle:
    def __init__(self, height, clouds, color):
        self.height = height
        self.clouds = clouds
        self.color = color
 
    def change_height(self, value):
        self.value = value
        if self.height + self.value < 0:
            return 0
        else:
            return self.height + self.value
 
    def call(self, prosp):
        self.prosp = prosp
        return self.height // self.prosp * self.clouds
 
    def str(self):
        return f'The AirCastle at an altitude of {self.height} meters is {self.color} with {self.clouds} clouds.'
 
    def __add__(self, number):
        self.clouds += number
        self.height += number // 5
        return self.clouds, self.height
 
    def __gt__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color > other.color
            else:
                return self.height > other.height
        else:
            return self.clouds > other.clouds
 
    def __lt__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color < other.color
            else:
                return self.height < other.height
        else:
            return self.clouds < other.clouds
 
    def __ge__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color >= other.color
            else:
                return self.height >= other.height
        else:
            return self.clouds >= other.clouds
 
    def __le__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color <= other.color
            else:
                return self.height <= other.height
        else:
            return self.clouds <= other.clouds
 
    def __eq__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color == other.color
            else:
                return self.height == other.height
        else:
            return self.clouds == other.clouds
 
    def __ne__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color != other.color
            else:
                return self.height != other.height
        else:
            return self.clouds != other.clouds
ac = AirCastle(100, 5, "white")
print(ac)
ac.change_height(15)
ac += 5
print(ac)
print(ac(3))
0
Programming
Эксперт
39485 / 9562 / 3019
Регистрация: 12.04.2006
Сообщений: 41,671
Блог
26.04.2021, 17:55
Ответы с готовыми решениями:

ошибки в коде, как исправить
import numpy as np import matplotlib.pyplot as plt from sympy import * import matplotlib as mpl mpl.rcParams = 'fantasy' ...

Исправить ошибки в коде Python
import math xn=float(input(&quot;xn =&quot;)) xk=float(input(&quot;xk =&quot;)) h=float(input(&quot;h =&quot;)) t=float(input(&quot;t =&quot;)) x=xn while(x&lt;=xk): ...

Исправить ошибки в коде Python
s= n=15 for i in range(n) : if(s==',' and s=='.'): s=' '; print(&quot;S= &quot;,s)

3
 Аватар для codcw
815 / 527 / 214
Регистрация: 22.12.2017
Сообщений: 1,495
27.04.2021, 04:21
rrrr22332, если последнюю строчку убрать, ошибки не будет
0
Эксперт Python
1356 / 653 / 207
Регистрация: 23.03.2014
Сообщений: 3,057
27.04.2021, 20:12
Python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
class AirCastle:
    def __init__(self, height, clouds, color):
        self.height = height
        self.clouds = clouds
        self.color = color
 
    def change_height(self, value):
        self.value = value
        if self.height + self.value < 0:
            return 0
        else:
            return self.height + self.value
 
    def call(self, prosp):
        self.prosp = prosp
        return self.height // self.prosp * self.clouds
 
    def str(self):
        return f'The AirCastle at an altitude of {self.height} meters is {self.color} with {self.clouds} clouds.'
 
    def __add__(self, number):
        self.clouds += number
        self.height += number // 5
        return self.clouds, self.height
 
    def __gt__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color > other.color
            else:
                return self.height > other.height
        else:
            return self.clouds > other.clouds
 
    def __lt__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color < other.color
            else:
                return self.height < other.height
        else:
            return self.clouds < other.clouds
 
    def __ge__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color >= other.color
            else:
                return self.height >= other.height
        else:
            return self.clouds >= other.clouds
 
    def __le__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color <= other.color
            else:
                return self.height <= other.height
        else:
            return self.clouds <= other.clouds
 
    def __eq__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color == other.color
            else:
                return self.height == other.height
        else:
            return self.clouds == other.clouds
 
    def __ne__(self, other):
        if self.clouds == other.clouds:
            if self.height == other.height:
                return self.color != other.color
            else:
                return self.height != other.height
        else:
            return self.clouds != other.clouds
ac = AirCastle(100, 5, "white")
print(ac)
ac.change_height(15)
ac += 5
print(ac)
#print(ac(3))
0
0 / 0 / 0
Регистрация: 05.04.2021
Сообщений: 2
28.04.2021, 14:46  [ТС]
спасибо большое
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
inter-admin
Эксперт
29715 / 6470 / 2152
Регистрация: 06.03.2009
Сообщений: 28,500
Блог
28.04.2021, 14:46
Помогаю со студенческими работами здесь

Исправить ошибки в коде Python
Файл содержит действительные числа. Найти среднее геометрическое всех положительных чисел файла. f = open('text.txt','r') from math...

Нужно исправить ошибки в коде
def ExpUser(x, Epsilon): s:int(1); term=1; i=0; while (abs(term) &gt; Epsilon): term=term*(x/(i+1)) s = s + term; i+=1 return s...

Исправить ошибки в коде Python c функцией
Формула: g=min\left( {x}_{i}^{2}-\left|{x}_{i} \right|\right) import math import random n=20 x= def min(i): for i in...

Исправить ошибки в коде лотереи
ВОТ КОД #Спортлото import random winning_nums = random.sample(range(1,36),6) counter = 1 print (&quot;Добро пожаловать в наш...

Admin panel не правильно работает из-за ошибки в models.py Разобрался где в коде ошибка но как исправить её?
from django.db import models # Create your models here. from django.urls import reverse # Used to generate urls by reversing the...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
4
Ответ Создать тему
Новые блоги и статьи
SDL3 для Desktop (MinGW): Рисуем цветные прямоугольники с помощью рисовальщика SDL3 на Си и C++
8Observer8 17.03.2026
Содержание блога Финальные проекты на Си и на C++: finish-rectangles-sdl3-c. zip finish-rectangles-sdl3-cpp. zip
Символические и жёсткие ссылки в Linux.
algri14 15.03.2026
Существует два типа ссылок — символические и жёсткие. Ссылка в Linux — это запись в каталоге, которая может указывать либо на inode «файла-ИСТОЧНИКА», тогда это будет «жёсткая ссылка» (hard link),. . .
[Owen Logic] Поддержание уровня воды в резервуаре количеством включённых насосов: моделирование и выбор регулятора
ФедосеевПавел 14.03.2026
Поддержание уровня воды в резервуаре количеством включённых насосов: моделирование и выбор регулятора ВВЕДЕНИЕ Выполняя задание на управление насосной группой заполнения резервуара,. . .
делаю науч статью по влиянию грибов на сукцессию
anaschu 13.03.2026
прикрепляю статью
SDL3 для Desktop (MinGW): Создаём пустое окно с нуля для 2D-графики на SDL3, Си и C++
8Observer8 10.03.2026
Содержание блога Финальные проекты на Си и на C++: hello-sdl3-c. zip hello-sdl3-cpp. zip Результат:
Установка CMake и MinGW 13.1 для сборки С и C++ приложений из консоли и из Qt Creator в EXE
8Observer8 10.03.2026
Содержание блога MinGW - это коллекция инструментов для сборки приложений в EXE. CMake - это система сборки приложений. Здесь описаны базовые шаги для старта программирования с помощью CMake и. . .
Как дизайн сайта влияет на конверсию: 7 решений, которые реально повышают заявки
Neotwalker 08.03.2026
Многие до сих пор воспринимают дизайн сайта как “красивую оболочку”. На практике всё иначе: дизайн напрямую влияет на то, оставит человек заявку или уйдёт через несколько секунд. Даже если у вас. . .
Модульная разработка через nuget packages
DevAlt 07.03.2026
Сложившийся в . Net-среде способ разработки чаще всего предполагает монорепозиторий в котором находятся все исходники. При создании нового решения, мы просто добавляем нужные проекты и имеем. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru