Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8881653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:23:24+00:00 2026-06-14T20:23:24+00:00

I am creating a python program that creates an xhtml table for websites based

  • 0

I am creating a python program that creates an xhtml table for websites based on a variable value.

please look at the following two codes. The second one does not work.

rows = int(input('How many rows would you like? '))
for i in range(rows):
    print 'lol'

rows = raw_input('How many rows would you like? ')
int(rows)
for i in range(rows):
    print 'lol'

even though i have properly stated that the rows variable is being changed to an integer, why doesn’t the range function accept this, and treat it as as integer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:23:25+00:00Added an answer on June 14, 2026 at 8:23 pm

    i have properly stated that the rows variable is being changed to an
    integer

    No, rows is not being changed to an integer. Just applying int(rows) on rows does not change the str object rows to int. But it returns an integer object.

    You would either need to store the return value in a variable, and use it. Or, directly use it in range function.

    int(rows)
    for i in range(rows):  // rows used here is still a string
    

    The above code should be: –

    for i in range(int(rows)):
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im creating a python program that connects to mysql. i need to check if
I am having problems creating a table in python. Basically I want to build
I have the following outline of a Python program (using PyQt4): class Polygon( QtGui.QGraphicsItem
I'm creating a simulator coded in python and based on ODE (Open Dynamics Engine).
I'am writing a multi-threaded program in C. Before creating the threads, a global python
I am in the process of creating a Java program that goes on the
I am creating a python gtk program which uploads videos to youtube in ubuntu
All discussion I've seen on SO_REUSEADDR assumes that it's the same program creating and
Im creating a program that prints out the Ip adress of the User. So
I have a small program in python that consists in one .py file plus

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.