+ 7
[Assignment] Print numbers from 1 to 100 witĥout using numbers in source code
Any appearance of number in code is not allowed. If the number is taken from user input, it is considered wrong. Waiting for yours solutions in any languages!!! Bonus - try to solve it without using python, 'cause it's just unfair thing in such assignments)
43 Antworten
+ 14
There are 2 variations in this code. Uncomment the line for the recursive version.
https://code.sololearn.com/c524KS9Id7Ot/?ref=app
+ 12
https://code.sololearn.com/cjscSQDNMiE8/?ref=app
⏬
nice Simba 😁 .
+ 9
https://code.sololearn.com/c9o2qZqcf7m7/?ref=app
+ 7
You're Welcome!
Btw, how about this?
[print(i) for i in range(True,ord('e'))]
+ 7
https://code.sololearn.com/cxhmzhafoeLh/?ref=app
+ 6
This is my code:
a = ["a","b","c"]
x = a.index("a")
while len(str(x)) < len(a):
x += a.index("b")
print(x)
https://code.sololearn.com/cR2yn40FK9ZD/?ref=app
+ 5
Simba
Clever code!
Well done
+ 5
https://code.sololearn.com/cZ2KHWFg8oNy/?ref=app
Obfuscated by hand :p
+ 4
https://code.sololearn.com/ctsgnp1w1wK6/?ref=app
No numbers and no loop😁
+ 4
Code is 34 char ☺️:
Thanks to Rik Wittkopp, the code now consists of 28 characters.
What a wonderful "*" operator.
https://code.sololearn.com/cLWFWosEOEUo/?ref=app
ÄKoderj, looking at your code, I got an idea for an interesting code ☺️:
p="HelloWorld"
print(*range(True,len(p*len(p)+'!')),end='')
+ 3
Simba, thank you for advice!
+ 3
Martin Taylor he said that there mustn't be “number” in source 😛..not after evaluation
+ 2
Ретр0 , Nope.
then it will give "TrueFalseTrue" string which cannot be converted to integer. I have tried.😉
+ 2
Ретр0 Here are three ways to do this:
#1
a, b = int(True), int(False)
print(*range(True, int(f"{a}{b}{a}")), sep="\n")
#2
a, b = int(False), int(True)
for i in range(True, int(eval(f"{a}b{b}{b}{a}{a}{b}{a}{b}"))): print(i)
#3
[print(i) for i in range(len("a"), len(""))]