473,513 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ways to "reset" raw_input

1 New Member
Is there any way of "reseting" the raw_input so it is able to =a rather than =x and is there anything else that is wrong with it ?:P Im using python 2.7.2

Expand|Select|Wrap|Line Numbers
  1. x = raw_input ("enter name here: ")
  2. print "hello " +x
  3. print "how are you? Good or bad?"
  4.  
  5. a=raw_input 
  6.  
  7. if a == "good":
  8.     print "awesome!"
  9. elif a== "bad":
  10.     print "oh no"
  11.  
  12.  
  13. print " why you " + a +"?"
  14.  
  15. raw_input("press <enter>")
Jun 27 '11 #1
1 2103
bvdet
2,851 Recognized Expert Moderator Specialist
Line number 5 needs parentheses after raw_input for the function call.
Jun 27 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1698
by: Draken | last post by:
I have a menu of radio buttons with the name myform (thank you to Evertjan. for your help with my other problem, I have no idea where the error was but I worked through it from your advice) pretty...
22
7835
by: Peter Ammon | last post by:
A friend was asked "How many ways are there to create an object in C++?" in an interview. Apparently, the "right" answer was eleven. Does anyone know how the interviewer arrived at that number? ...
4
2424
by: Amir | last post by:
What's the difference between the two ways of opening a new window and writing to it? Let's say I prepare a code that goes into a new window and save it in a variable winHTML: var winHTML =...
2
1651
by: big vinny | last post by:
Hi I've been writing some serializing functions to load/store classes into db tables. There appears to be 2 ways of doing it, 1) iterative, derived classes store their parent's data before...
8
1440
by: Asha | last post by:
greetings, besides using objconn.State() to find out if a sql connection is close or open, is there any other way to accomplish this task? thanks in advance. anywhere is sql server or the machine...
9
1434
by: storyGerald | last post by:
I knew some ways of swapping two ints without using a temporary variable. Just like: // Method 1: void swap1(int &a, int &b) { int temp = a; a = b; b = a; }
2
1731
by: Chetan Raj | last post by:
Hi, What are the different ways in which a virtual function can be implemented by the C++ compiler? I know VTABLE and VPOINTER is only one of the way. What are the other ways? What are the pros...
1
2160
by: Piper707 | last post by:
Hi, I'd like to know if there are any more ways of restricting an XML document to having only non-empty tags (containing Strings). I can think of 2 ways: 1) <xs:simpleType name="tagName">
2
15871
by: Jen | last post by:
So I have the need to take UtcNow and change the Second to zero. Just wondering how many ways there are to do that?
0
1855
by: geshan | last post by:
Lets see and compare the 4 ways (not tools) to develop/code your own PHP website or web application. The following are the ways you can code/develop your application (involving more Create Read...
0
7553
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7120
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5697
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.