Skip to content

Commit 06e401f

Browse files
committed
Add randome string
1 parent da25aab commit 06e401f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

calculator/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# BMI Calculator
22

3-
The Body Mass Index (BMI) or Quetelet index is a value derived from the mass (weight) and height of an individual, male or female. The BMI is defined as the body mass divided by the square of the body height and is universally expressed in units of kg/m2, resulting from the mass in kilograms and height in meters. The formula is:
4-
3+
The Body Mass Index (BMI) or Quetelet index is a value derived from the mass (weight) and height of an individual, male or female. The BMI is defined as the body mass divided by the square of the body height and is universally expressed in units of kg/m2, resulting from the mass in kilograms and height in meters. The formula is:
54

6-
BMI = (mass or weight)/(height*height)
5+
BMI = (mass or weight)/(height\*height)
76
where,
87
mass or weight is in Kg,
98
height is in meters

randomstring.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import random
2+
import string
3+
4+
def rand_string(length):
5+
letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
6+
result = ''.join(random.choice(letters) for i in range(length))
7+
print("Random string of length", length, "is:", result)
8+
9+
rand_string(8)

0 commit comments

Comments
 (0)