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

  • Home
  • SEARCH
  • 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 8965257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:46:16+00:00 2026-06-15T16:46:16+00:00

I am new to python. I am trying to make a small elavator program.

  • 0

I am new to python. I am trying to make a small elavator program.

The code:

import time
elavator = True
# 0 is B floor // basement
elavatorFloors = [0,1,2,3,4,5]

while elavator == True:
    getLevel = input ("Which floor would you like to visit? ( 1 - 5) ")
    time.sleep(2)
    print "you're now at floor, " +int.getLevel

I get this error: AttributeError: type object ‘int’ has no attribute ‘getLevel’
Aside from changing the str to int, am I using any bad technique? I really want to improve my programming thinking and code writing. Thank you 🙂

  • 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-15T16:46:17+00:00Added an answer on June 15, 2026 at 4:46 pm

    int() is a type, so to instantiate it, you need to do int(getLevel), not int.getLevel.

    Check the docs for examples and more.

    Also note that getLevel is an odd name for the variable, as it implies it is a function that gives the level. A better name would be just level.

    It’s also worth noting that input() evaluates the input as Python code (In Python 2.x, in 3.x it acts as raw_input() does in older versions), so getLevel will already be a number, although I would recommend using raw_input() instead, and keeping your conversion from a string to an integer, as it won’t allow arbitrary execution of code, which is much better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm completely new to Python and I've been trying to make a fibonacci program
I'm really new to Python. I'm trying to import a third party module called
new to python here. I am trying to write a program that calculate the
I'm new to Python and am trying to make use of it to parse
I am new to python and I am trying to import some values from
Hey I am very new to python but I am trying to make a
I'm trying to make a Python program that retrieves only the body text of
I am new to python and I'm trying to create a program that creates
I'm new to python and I'm trying to make a search bar that searches
I'm trying to make a program in python which creates a fullscreen window and

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.