파이썬 독학중인 왕초보 디자인과 학생 인데 안풀리는 문제가 있어서 글을 올려봅니다 ㅠ.ㅠ

  • #3250753
    OKKKay 143.***.59.80 1648

    안녕하세요, 게시판 성격에 맞지 않는다는 걸 잘 알지만 유튜브로는 한계가 있어서 이렇게 글을 올려보게 되었습니다. ㅠㅠ
    디자인으로는 한계가 있는 것 같아서 코딩 스킬을 조금이라도 늘이려고 하는데.. 혼자서는 한계가 있네요

    It’s time for a Countdown! You’ve been tasked with creating a timer with text reminders. Write a function that takes in an integer and prints a reminder statement for each minute as it counts down. Spacing is important!
    Use the range function to generate these numbers
    Test Cases:
    >>>timer(6)
    There are 6 minutes left.
    There are 5 minutes left.
    There are 4 minutes left.
    There are 3 minutes left.
    There are 2 minutes left.
    There is 1 minute left.
    Times up!

    >>>timer(3)
    There are 3 minutes left.
    There are 2 minutes left.
    There is 1 minute left.
    Times up!

    • OKKKay 143.***.59.80

      ㅠㅠ;; 부끄러울정도로 초보 문제이긴 합니다만 저는 그마저도 모르기 때문에 부끄럼과 민폐를 무릎쓰고 글 올려봅니다..
      미리 감사드립니다.

    • 12 198.***.103.151

      def timer(x):
      __while x>1:
      ____print “There is %d minutes left.” % x
      ____x-=1
      __if x==1:
      ____print “There is 1 minute left”
      print “Times up”

    • OKKKay 143.***.59.80

      자꾸 에러가 뜰까요 ㅠ.ㅠ;;
      제가 공부하는 것이 Java based Python이라 (Jathon) 이라 그럴까요?
      Invalid syntax.
      Your code contains at least one syntax error, meaning it is not legal Jython.
      이 에러가 뜨네요..
      소중한 시간 내주셔서 댓글 남겨주셔서 감사합니다.

    • 지나가다 149.***.7.28

      https://stackoverflow.com/questions/7531945/python-range-function

      stackoverflow 검색을 생활화 하시고, 한글로 문답하고 싶으면 오유의 프로그래머 게시판같은데 가시면 됩니다.

      http://www.todayhumor.co.kr/board/list.php?table=programmer

    • OKKKay 143.***.59.80

      헉 좋은 싸이트 알려주셔서 감사합니다. 몰랐던 사이트 들인데 도움이 많이되었습니다!!

    • CS 168.***.53.114

      자신이 그동안 짠 코드를 보여주고 어디가 틀렸는지 묻는 것도 아니고… 이건 거의 숙제 대신해달라는 식인데요? 이러면 실력 절대 안늡니다.

    • 12 24.***.58.108

      _를 스페이스로 바꾸셔야 하는건 아시죠?

    • 유학생 222.***.77.210

      for-loop을 쓰실거시면 이렇게 하셔도되요 ㅎㅎ
      다른님이 말씀하신대로 왠만한거는 stack-oveflow보고 하시는게 좋으실거에요!
      def timer(n):
      for i in range(n,0,-1):
      print”There are “+str(i)+” minutes left”

      print “Times up!”

    • OKKay 67.***.240.153

      모두 친절한 답변 감사합니다!! 더욱 열심히 공부해서 언젠간 꼭 코드라는것을 짜보고 싶습니다! 다시한번 감사드려요. 유학생님 감사합니다