sykoticm's Profile User Rating: -----

Reputation: 2 Apprentice
Group:
Members
Active Posts:
28 (0.03 per day)
Joined:
07-October 11
Profile Views:
1,267
Last Active:
User is offline Mar 31 2013 04:55 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0
Icon   sykoticm Computers these days.

Posts I've Made

  1. In Topic: raw_input, printing, and user input questions...

    Posted 30 Mar 2013

    View PostMekire, on 31 March 2013 - 12:19 AM, said:

    Well, I don't really know Java, but nonetheless I guarantee that the way you are trying to justify things is grossly overcomplicating them.

    raw_input is a function. It will print the string argument it is passed and then wait for a user input. The string argument you pass it is not part of the return value.

    a = raw_input("Input whatever: ")
    
    will assign the return value of the raw_input function to a. a couldn't care less what string you passed to raw_input.

    As for your functions you wrote at the end, they don't work because variables defined in functions are local. You need to return values from functions.

    Pretty much the way you did it originally is probably what you want though:
    a = raw_input("Enter a string: ") 
    print (a)
    
    a now holds the value of the raw_input (what the user typed; not the string you passed to raw_input) and you also printed a to the screen (which seems redundant as the user just typed it). What about this isn't what you want?

    -Mek


    I seem to over complicate lots of things

    It isn't what I want I'm just trying to understand the syntax... So now that you have confirmed that the variable is local.... how do I make a variable that isn't local that I could use in another defined function? Could do something like this:

    
    #a would be a local variable (i know this is wrong its just an example)
    String a
    
    b = raw_input("enter a string")
    
    a = b
    
    print(B)/>/>/>
    
    
    


    I don't know what the "/>" is about after
    print(B)/>/>
    
    i have deleted it several times in the edit option and then re-posted but it keeps appearing.

    Does that make sense?


    ok this is weird and annoying /> keeps showing up in my posts and i don't know why after deleting them and submitting the modified post they still exist

My Information

Member Title:
New D.I.C Head
Age:
19 years old
Birthday:
December 1, 1994
Gender:
Location:
Oklahoma
Interests:
Computer, and more computers.
Full Name:
Matt

Contact Information

E-mail:
Private
AIM:
AIM  nope
MSN:
MSN  nope
Website URL:
Website URL  http://non existant
ICQ:
ICQ  nope
Yahoo:
Yahoo  why?
Jabber:
Jabber  nope
Skype:
Skype  yeah, but no.
LinkedIn:
nope
Facebook:
of course not
Twitter:
same as above
Xfire:
yeah, but no.

Friends

Comments

Page 1 of 1
  1. Photo

    Sho Ke Icon

    07 Dec 2011 - 23:39
    Touche..
  2. Photo

    Sho Ke Icon

    06 Dec 2011 - 22:28
    I'm on your profile, creepin' on your posts.
Page 1 of 1