0 / 0 / 0
Регистрация: 05.04.2021
Сообщений: 2

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

26.04.2021, 17:55. Показов 691. Ответов 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
Ответ Создать тему
Опции темы

Новые блоги и статьи
Валидация и контроль данных табличной части документа перед записью
Maks 22.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа, разработанного в КА2. Задача: контроль и валидация данных табличной части документа перед записью с учетом регламента компании. . .
Отчёт о затраченных материалах за определенный период с макетом печатной формы
Maks 21.04.2026
Отчёт из решения ниже размещён в конфигурации КА2. Задача: разработка отчёта по затраченным материалам за определённый период, с возможностью вывода печатной формы отчёта с шапкой и подвалом. В. . .
Отчёт о спецтехнике находящейся в ремонте
Maks 20.04.2026
Отчёт из решения ниже размещен в конфигурации КА2. Задача: отобразить спецтехнику, которая на данный момент находится в ремонте. Есть нетиповой документ "Заявка на ремонт спецтехники" который. . .
Памятка для бота и "визитка" для читателей "Semantic Universe Layer (Слой семантической вселенной)"
Hrethgir 19.04.2026
Сгенерировано для краткого описания по случаю сборки и компиляции скелета серверного приложения. И пусть после этого скажут, что статьи сгенерированные AI - туфта и не интересно. И это не реклама -. . .
Запрет удаления строк ТЧ документа при определённом условии
Maks 19.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "Аккумуляторы", разработанного в конфигурации КА2. У данного документа есть ТЧ, в которой в зависимости от прав доступа. . .
Модель заражения группы наркоманов
alhaos 17.04.2026
Условия задачи сформулированы тут Суть: - Группа наркоманов из 10 человек. - Только один инфицирован ВИЧ. - Колются одной иглой. - Колются раз в день. - Колются последовательно через. . .
Мысли в слух. Про "навсегда".
kumehtar 16.04.2026
Подумалось тут, что наверное очень глупо использовать во всяких своих установках понятие "навсегда". Это очень сильное понятие, и я только начинаю понимать край его смысла, не смотря на то что давно. . .
My Business CRM
MaGz GoLd 16.04.2026
Всем привет, недавно возникла потребность создать CRM, для личных нужд. Собственно программа предоставляет из себя базу данных клиентов, в которой можно фиксировать звонки, стадии сделки, а также. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru