Skip to content

Commit 91f314b

Browse files
author
Amogh Singhal
authored
Create hundred_without_int.py
1 parent bfaf2b9 commit 91f314b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

hundred_without_int.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Print numbers 1 to 100 without using any numbers or integers
2+
3+
ONE = str(int(True))
4+
ZERO = str(int(False))
5+
HUNDRED = int(ONE + ZERO + ZERO)
6+
7+
for i in range(int(ONE), HUNDRED+1):
8+
print(i, end=', ')
9+
10+
# OUTPUT (Actual prints in the same line, line breaks given here for code clarity):
11+
12+
# 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
13+
# 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
14+
# 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
15+
# 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
16+
# 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
17+
# 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
18+
# 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
19+
# 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
20+
# 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
21+
# 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,

0 commit comments

Comments
 (0)