 
      
    Python
- 2 ответа
- 0 вопросов
    1
    Вклад в тег
    
      
      
    
  
  
dict1 = {1: 'one', 2: 'two'}
dict2 = {3: 'three'}
dict2.update(dict1)
dict2
>> {3: 'three', 1: 'one', 2: 'two'}
a = {1: 111, 2: 222, 3: 333}
b = {1: 444, 2: 555, 4: 666, 5: 777}
b.update(a)
b
>> {1: 111, 2: 222, 4: 666, 5: 777, 3: 333}def triangle(a, b, c):
    #Отсортируем стороны в порядке возрастания для удобства
    a, b, c = sorted([a, b, c])
    if c < a + b:
        if is_equilateral(a, b, c):
            print("Equilateral")
        elif is_right(a, b, c) and is_isosceles(a, b, c):
            print("Right isosceles")
        elif is_right(a, b, c):
            print("Right")
        elif is_isosceles(a, b, c):
            print("Isosceles")
        else:
            print("Simple")
    else:
        print("Triangle doesn't exist")
    repeat = input("Repeat - y\nExit - n\n")
    if repeat == "y":
        triangle1()
    elif repeat == "n":
        print("Shutting down")
start = input("1 - English\n2 - Русский\n")
if start == "1":
    triangle1()
elif start == "2":
    triangle2()