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 8943647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:49:43+00:00 2026-06-15T11:49:43+00:00

The raw_input is generally used for taking a respond of prompt to a string,

  • 0

The “raw_input” is generally used for taking a respond of prompt to a string, and then it can be also assigned(=) by a variable.

But I found something strange(for me) and can’t well understand. In a mistake incident case(see example below), I put a equal(==) for assigning variable in a function. Then I run it in interpreter and didn’t have any error. I through my script was well done but it could not work as my expert.

My questions:
I would like to know this usage of “raw_input” in Python is correct?
If yes, how we use it?
If not, why don’t interpreter give us a error warning?

Thank you so much.

Example:

Python 2.7.3 (default, Apr 24 2012, 00:00:54) 
[GCC 4.7.0 20120414 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> v = "Variable"
>>> def test():
...     v == raw_input(">")
...     print v
... 
>>> test()
>Hello!
Variable
>>> 
  • 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-15T11:49:45+00:00Added an answer on June 15, 2026 at 11:49 am

    This:

    v == raw_input(">")
    

    is simply a comparison. You get True or False as a result and then throw it away, because you don’t give it a name. You could write

    comparison = v == raw_input(">")
    print comparison
    

    to see the value.

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

Sidebar

Related Questions

I'm using raw_input() to storing a message inside a variable. So I can't press
I'm trying to do: raw_input(Anyone Home?) But I'm getting syntax error! I'm using Python
I'm trying something like this Output.py print Hello Input.py greeting = raw_input(Give me the
Let's say I have a standard Python string (such as one obtained from raw_input()
Is it possible to use raw_input with a variable? For example. max = 100
For the simple snippet below a = raw_input(Enter a number: ) How can I
I'm using raw_input() to receive password from user in interactive mode, but I want
Is there a way to give the user a raw_input, but give a null
I am aware that raw_input cannot be used in twisted. However here is my
Possible Duplicate: Easy: How to use Raw_input in 3.1 in old style i can

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.