title: How to convert elements(string) to integer in tuple in Python
body: <p>I am still learning Python and currently solving a question on <a href="https://www.hackerrank.com/challenges/python-tuples" rel="noreferrer">Hackerrank</a> where I am thinking of converting input(String type) to tuple by using built-in function(tuple(input.split(" ")). </p>
  
  <p>For example, myinput = "2 3", and I want to convert it to tuple,such as (2,3). However,if I do that, it will, of course, give me a tuple with String type, like ('2', '3').  I know that there are a lot of ways to solve the problem, but I'd like to know how to convert elements(str) in tuple to integer(in Python) in most efficient way.</p>
  
  <p>See below for more details. </p>
  
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; myinput = "2 3"
  &gt;&gt;&gt; temp = myinput.split()
  &gt;&gt;&gt; print(temp)
  ['2', '3']
  &gt;&gt;&gt; mytuple = tuple(myinput)
  &gt;&gt;&gt; print(mytuple)
  ('2', ' ', '3')
  &gt;&gt;&gt; mytuple = tuple(myinput.split(" "))
  &gt;&gt;&gt; mytuple
  ('2', '3')
  &gt;&gt;&gt; type(mytuple)
  &lt;class 'tuple'&gt;
  &gt;&gt;&gt; type(mytuple[0])
  &lt;class 'str'&gt;
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>Thanks in advance.</p>