ModuleNotFoundError: нет модуля с именем «_typeshed»Python

Программы на Python
Anonymous
ModuleNotFoundError: нет модуля с именем «_typeshed»

Сообщение Anonymous »

Мне было поручено создать класс в Google Colab.
Вот код, который я создал:

Код: Выделить всё

from _typeshed import Self

class Customers:
greeting = 'Welcome to the Coffee Palace!'

def __init__(self, name, beverage, food, total):
self.name = name
self.beverage = beverage
self.food = food
self.total = total

c1 = Customers()
c2 = Customers()

c1.name = 'Samirah'
c1.beverage = 'Iced caffe latte'
c1.food = 'Cinnamon roll'
c1.total = 225

c2.name = 'Jerry'
c2.beverage = 'Caramel macchiato'
c2.food = 'Glazed doughnut'
c2.tota = 230

print('Samirah wants to drink '+ c1.beverage)
print('Jerry wants to eat '+ c2.food)
Но эта ошибка продолжает появляться:

Код: Выделить всё

ModuleNotFoundError                       Traceback (most recent call last)
 in ()
----> 1 from _typeshed import Self
2 #CodeHere
3 class Customers:
4   greeting = 'Welcome to the Coffee Palace!'
5

ModuleNotFoundError: No module named '_typeshed'
Я не знаю, как это исправить и есть ли в моем коде какие-то ошибки.

Вернуться в «Python»