+ 3

How to use variable as integer?

9th Mar 2021, 7:02 AM
❴Amit ❵
❴Amit ❵ - avatar
5 Antworten
+ 3
A variable can't start with integer. But you can do it like this _1 ="hi" print(_1) https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2428/
9th Mar 2021, 8:23 AM
Simba
Simba - avatar
+ 5
convert that variable to integer : int(variable)
9th Mar 2021, 7:06 AM
Med Amine Fh
Med Amine Fh - avatar
+ 3
Variable names doesnt start with numeric value. It is one of the standard in coding. use underscore if you want numeric variable. _1 = “hi” print(_1)
9th Mar 2021, 8:23 AM
Sharique Khan
Sharique Khan - avatar
+ 2
Type cast it 😇
11th Mar 2021, 4:15 AM
Sanjay Kamath
Sanjay Kamath - avatar