+ 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)

5th Jul 2021, 9:56 AM
Ретр0
43 Antworten
+ 14
There are 2 variations in this code. Uncomment the line for the recursive version. https://code.sololearn.com/c524KS9Id7Ot/?ref=app
5th Jul 2021, 10:42 AM
ChaoticDawg
ChaoticDawg - avatar
+ 12
https://code.sololearn.com/cjscSQDNMiE8/?ref=app ⏬ nice Simba 😁 .
5th Jul 2021, 10:52 AM
Prashanth Kumar
Prashanth Kumar - avatar
7th Jul 2021, 5:29 AM
Pallavi Bhardwaj
Pallavi Bhardwaj - avatar
+ 9
https://code.sololearn.com/c9o2qZqcf7m7/?ref=app
5th Jul 2021, 5:56 PM
Johann
Johann - avatar
+ 7
You're Welcome! Btw, how about this? [print(i) for i in range(True,ord('e'))]
5th Jul 2021, 10:23 AM
Simba
Simba - avatar
+ 7
https://code.sololearn.com/cxhmzhafoeLh/?ref=app
5th Jul 2021, 8:15 PM
Javier Felipe Toribio
Javier Felipe Toribio - avatar
26th Sep 2021, 1:21 PM
Janusz Bujak 🇵🇱 🇺🇦
Janusz Bujak 🇵🇱 🇺🇦 - avatar
5th Jul 2021, 9:57 AM
Simba
Simba - avatar
+ 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
6th Jul 2021, 8:23 AM
TCorn
TCorn - avatar
+ 5
Simba Clever code! Well done
5th Jul 2021, 10:37 AM
Rik Wittkopp
Rik Wittkopp - avatar
5th Jul 2021, 12:46 PM
Shadoff
Shadoff - avatar
+ 5
https://code.sololearn.com/cZ2KHWFg8oNy/?ref=app Obfuscated by hand :p
6th Jul 2021, 11:08 AM
Pemadam
6th Jul 2021, 3:59 PM
Oma Falk
Oma Falk - avatar
+ 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='')
25th Nov 2021, 12:45 PM
Solo
Solo - avatar
+ 3
Simba, thank you for advice!
5th Jul 2021, 10:04 AM
Ретр0
+ 3
Martin Taylor he said that there mustn't be “number” in source 😛..not after evaluation
5th Jul 2021, 11:03 AM
Prashanth Kumar
Prashanth Kumar - avatar
+ 2
Ретр0 , Nope. then it will give "TrueFalseTrue" string which cannot be converted to integer. I have tried.😉
5th Jul 2021, 12:59 PM
Shadoff
Shadoff - avatar
+ 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(""))]
5th Jul 2021, 4:18 PM
Calvin Thomas
Calvin Thomas - avatar