+ 3
I want add 3 to start and end of 253 number in Python. How i can do it.
question
9 Respuestas
+ 4
a math joke ;-)
https://code.sololearn.com/cdcPL6t0FS1G/?ref=app
+ 8
Solution with decorator
https://code.sololearn.com/c6szXsh44Ln6/?ref=app
+ 6
print(3,253,3,sep='')
it is a bit more pythonic perhaps
+ 5
list = [3,253,3]
print(''.join(list))
+ 4
Now using list functions:
https://code.sololearn.com/cg4WjM39Eh28/?ref=app
+ 3
You may transform the number into a string and then add the characters:
number = 253
print (int('3'+str(number)+'3'))
+ 2
thanks
+ 2
thanks
+ 2
Using the last char index:
num = '253'
print(int(num[-1] + num + num[-1]))