편집 기록

편집 기록
  • 프로필 nowp님의 편집
    날짜2020.05.11

    파이썬 코드를 짰는데 오류가 떠요 TurtleGraphicsError: Bad arguments for register_shape.


    import turtle
    import random
    
    t = turtle.Turtle
    s = turtle.Screen()
    
    img1 = "smile"
    img2 = "back"
    
    s.addshape(img1)
    s.addshape(img2)
    
    a = random.randint(1,10)
    b = random.randint(1,10)
    
    print(a, "+" , b, "=")
    
    x =input()
    c = int(x)
    
    if a+ b == c:
        print("정답입니다.")
        t.shape(img1)
    else:
        print("틀렸습니다. 정답은"+str(a+b)+"입니다.")
        t.shape(img2)
    

    이렇게 코드를 짰는데요,

    Traceback (most recent call last):
      File "C:/Users/asd/Desktop/교재 코드 모음/chapter06/6-8 산수문제못ㄱ.py", line 12, in <module>
        s.addshape(img1)
      File "C:\Users\asd\AppData\Local\Programs\Python\Python38\lib\turtle.py", line 1135, in register_shape
        raise TurtleGraphicsError("Bad arguments for register_shape.\n"
    turtle.TurtleGraphicsError: Bad arguments for register_shape.
    Use  help(register_shape)
    

    이렇게 오류가 뜨는데 뭘 고쳐야 할까요??

  • 프로필 엽토군님의 편집
    날짜2020.05.10

    파이썬 코드를 짰는데 오류가 떠요


    import turtle
    import random
    
    t = turtle.Turtle
    s = turtle.Screen()
    
    img1 = "smile"
    img2 = "back"
    
    s.addshape(img1)
    s.addshape(img2)
    
    a = random.randint(1,10)
    b = random.randint(1,10)
    
    print(a, "+" , b, "=")
    
    x =input()
    c = int(x)
    
    if a+ b == c:
        print("정답입니다.")
        t.shape(img1)
    else:
        print("틀렸습니다. 정답은"+str(a+b)+"입니다.")
        t.shape(img2)
    

    이렇게 코드를 짰는데요,

    Traceback (most recent call last):
      File "C:/Users/asd/Desktop/교재 코드 모음/chapter06/6-8 산수문제못ㄱ.py", line 12, in <module>
        s.addshape(img1)
      File "C:\Users\asd\AppData\Local\Programs\Python\Python38\lib\turtle.py", line 1135, in register_shape
        raise TurtleGraphicsError("Bad arguments for register_shape.\n"
    turtle.TurtleGraphicsError: Bad arguments for register_shape.
    Use  help(register_shape)
    

    이렇게 오류가 뜨는데 뭘 고쳐야 할까요??

  • 프로필 알 수 없는 사용자님의 편집
    날짜2020.05.10

    파이썬 코드를 짰는데 오류가 떠요


    import turtle import random

    t = turtle.Turtle s = turtle.Screen()

    img1 = "smile" img2 = "back"

    s.addshape(img1) s.addshape(img2)

    a = random.randint(1,10) b = random.randint(1,10)

    print(a, "+" , b, "=")

    x =input() c = int(x)

    if a+ b == c: print("정답입니다.") t.shape(img1) else: print("틀렸습니다. 정답은"+str(a+b)+"입니다.") t.shape(img2)

    이렇게 코드를 짰는데요,

    Traceback (most recent call last): File "C:/Users/asd/Desktop/교재 코드 모음/chapter06/6-8 산수문제못ㄱ.py", line 12, in s.addshape(img1) File "C:\Users\asd\AppData\Local\Programs\Python\Python38\lib\turtle.py", line 1135, in register_shape raise TurtleGraphicsError("Bad arguments for register_shape.\n" turtle.TurtleGraphicsError: Bad arguments for register_shape. Use help(register_shape)

    이렇게 오류가 뜨는데 뭘 고쳐야 할까요??