How to change string to integer in for loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to change string to integer in for loop

I want to change my string input into int in for loop . So how to do that ?

6th Jul 2020, 11:48 AM
harshit
2 Answers
+ 6
Before we can help you, you should have done a try by yourself first. Please put your code in playground and lik it here. Thanks!
6th Jul 2020, 11:55 AM
Lothar
Lothar - avatar
+ 2
num = int(input('Enter a number > ')) print(num + 5)
6th Jul 2020, 11:50 AM
Slick
Slick - avatar