Random numbers ranged 1 to 10 in Python

To get a random number between 1 and 10 in Python, you can use the randint function from the random module:

import random

# Generate a random integer between 1 and 10 (inclusive)
random_number = random.randint(1, 10)

print(random_number)

Explanation

  • random.randint(1, 10) returns a random integer in the range [1, 10], where both 1 and 10 are inclusive.

This will generate a new random number each time you run the code.

댓글

이 블로그의 인기 게시물

Delete topic on Kafka, 카프카 토픽 삭제하기

ftplib.error_perm: 550 Permission denied

JAVA 실행 스크립트

how to delete all issues on project in sentry, 센트리 이슈 삭제하기

Offset out of range error in Kafka, 카프카 트러블슈팅

Reactjs datetime range picker

Pyspark 를 사용한 테이블 조인, table join with pyspark

Create fixed rounded button by Tailwind

To change the ESE index in Fluent Bit

To create a drawer in the footer using Tailwind CSS