Python Forum

Full Version: converting string object inside a list into an intiger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,guys!

import sys
a = sys.argv
a.remove('C:\\Users\\USER\\Desktop\\app\\as4t.py')

print(a)

C:\Users\USER\Desktop\app>as4t.py 1 2 3
['1', '2', '3']

How can i make that output [1, 2, 3]?
Hi guys!

import sys


a = sys.argv
a.remove('C:\\Users\\USER\\Desktop\\app\\as4t.py')
print(a)

C:\Users\USER\Desktop\app>as4t.py 1 2 3
['1', '2', '3']

How can i make my output[1, 2, 3]?
listname[index] = int(listname[index])
@bwdu, Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.

also, don't start new threads unnecessarily
@bwdu, I strongly advise you to think carefully before posting any further without following Forum Rules or risk permanent ban. Giving negative rep to Moderator for advising you to follow rules is really stupid and childish.