숫자나 문자 맞추는 코드
파이썬, vscode(비쥬얼스튜디어코드)에 설치하고 공부하기 위한 간단한 숫자나 문자 맞추는 코드를 입력해보겠습니다!
일단 문자를 입력하는 건 hello world또는 hello python code를 입력해볼것이고 숫자는 1~100까지의 숫자를 try ~ catch문을 이용해서 정수값을 반환하는 코드를 설명해보겠습니다.
-python 문자 입력 코드
import os
length = “hello python code”
print(length)
-숫자 맞추는 게임
import random
random_number = random.randint(1, 100) # 정수값 반환
game_count = 1
while True:
try:
my_number = int(input(“1~100 사이의 숫자를 입력하시오: “))
if my_number > random_number:
print(“다운”)
elif my_number < random_number:
print(“업”)
elif my_number == random_number:
print(“축하합니다. 랜덤수는 {random_number}이며 {game_count}회 만에 맞췄습니다.”)
break
game_count = game_count + 1
except:
print(“Error 발생, 숫자 입력하시오!”)
cheap priligy More vaccines are under clinical development and are being assessed for efficacy and safety
We offer our best wishes to anyone struggling to have a baby priligy tablets over the counter Baker Avantor Center Valley, PA USA, ammonium formate from Fluka Buchs, Switzerland, and ultrapure Milli Q water Millipore Corp
can i purchase cytotec without insurance Prolonged Ca v О± 1F expression in mature retina rescues rod synapse morphology
Your article helped me a lot, is there any more related content? Thanks! https://accounts.binance.info/en-IN/register?ref=UM6SMJM3