+ 2
how to print 12345 in one row without using string
8 ответов
+ 8
print(*(n for n in range(1,6)), sep="") or just print(12345) as suggested by Diego
+ 6
Language - Python
This might be cheating but try it:
num = 12345; print(num)
And next time please specify the programming language.
+ 5
Another way of getting the same result:
print(chr(49)+chr(50)+chr(51)+chr(52)+chr(53))
+ 3
In Python:
for i in range (1,6):
print (i,end='')
Output: 12345
+ 2
in Java:
for (int i=0; i<5; i++) { System.out.print(i+1)}
+ 2
in python 2/3
print(12345)
+ 1
language - JavaScript
console.log( Number( [...Array(5)].map((n, i) => i + 1).join('') ))
+ 1
Language: python
Hey,try this:
print(pow(1111,2)//pow(10,3))