+ 1
I want help in python
If i wanted to my computer that i want a random input from the user (int) but i want to add for it the unit for example 30 + kg = 30kg but i forgot how to do it
5 Answers
+ 2
you can also use f-string to convert to string and concatenate in one step.
num = int(input())
print( f'{num}kg')
+ 2
You have an integer and a string now. Just convert the integer into a string then concatenate both.
+ 1
You can re-read all lessons previously completed.
0
I forgot how to do it it been 2 weeks since last time i used sololearn đ
đ€Łđ€Ł
0
you can use str(Other type of value) for that
print(str(30) + âkgâ)