인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

subak's profile image
subak

asked

Dr. Nam's Python Basics, 100% Practical Use

Create a number guessing game (Python basics, random functions, loops, conditional statements)

함수의 파라미터값 msg

Written on

·

26

0

안녕하세요 강사님,

def input_check(msg, casting=int):

부분에서 msg 파라미터 값은 왜 들어있는건가요?

제가 진행해보았을때는 msg 파라미터값을 없애고 진행해도 게임이 진행됩니다.

def input_check(casting=int):
    while True:
        try:
            user_input = casting(input("몇 일까요? > "))
            return user_input
        except:
            print("숫자만 입력하세요.")
            continue

...

...

while count < chance :
    count += 1
    user_input = input_check()
    if user_input == number :
        break
    elif user_input < number :
        print("{} 보다 큰 숫자 입니다.".format(user_input))
    elif user_input > number :
        print("{} 보다 작은 숫자 입니다.".format(user_input))

 

감사합니다.

 

python웹-크롤링

Answer

This question is waiting for answers
Be the first to answer!
subak's profile image
subak

asked

Ask a question