코딩하고 싶습니다 : cc가 음수이면 cc는 0이되어야합니다. cc는 변수가됩니다. 어떻게해야합니까? 삽입 된 코드는 내 코드의 한 섹션 일뿐입니다.조건문, 파이썬, pyscripter를 사용하여 somehting과 같게 변수를 변경하는 방법
if cc <0 :
then cc == 0
print("The skill you have inputted is negative, it will stored as 0")
elif dd <0 :
then dd == 0
print ("The skill you have inputted is negative, it will be stored as 0")
else :
print ("Don't worry nothing has changed!")
지금 이가 맞습니까?
if cc <0 or dd <0:
cc == 0
dd ==0
print("The skill you have inputted is negative, it will stored as 0")
else :
print ("Don't worry nothing has changed!")
if c==0 or d==0:
print("The strength you inputted is 0. Your character dies.")
elif c<0 or d<0:
print("The strength you have inputted is negative. Your character dies.")
else :
print ("Don't worry nothing has changed!")
그래서 'cc'가 0보다 큰 경우'dd '값에 어떤 영향을 미치지 않습니까? –
dd가 같으면 dd가 음수이면 dd는 0이되어야합니다 – user3569687
그런 다음 조건을 'elif' 절에 넣으면 안됩니다 ... –