Counting the number of iterations in a loop

时间:2015-05-08 10:07:11

标签: python python-2.7 while-loop

How can we count the number of input given by the user in while loop?

Say user enters 50 numbers. How can I count that number of input.

For example,

  function select_pk2(cell){
  var val = $('#query_form_opt_'+cell+'_1').val();
  var t = $('#query_form_select_ops').val()
  var opts = JSON.parse($('#query_form_select_ops').val()); 

  var pk2 = JSON.stringify(opts[val]["rows"])
  var pk3 = JSON.stringify(opts[val]["cols"])

  $('#query_form_opt_'+cell+'_2').val(pk2)
  $('#query_form_opt_'+cell+'_3').val(pk3) 

  }
</script>

0 个答案:

没有答案