firstName = raw_input("Please enter your first name "); #This prompts the user for their first name, be sure to use raw_input from now on. Also name variables correctly... if (firstName.lower())== "dude": print("\nFreedom of passage granted. \nEnjoy your day %s.") %firstName.lower() #using %s (meants %string) and then putting %x outside the () (x being whatever variable you want to copy in is good for UI.) else: print("\nWho the hell are you? \nGo away"); #p.s. clean your code up, using \n puts text on a new line without bogging up code. #quit being a retard! You only use input() when dealing with predefined variable, raw_input() only takes input from the keyboard and thus is perfect for this situaton. # P.P.S learn to camelCase, comment, and use correct syntax. ALSO use fucking colons to end statements damnit, god you need to go back to your rudimentary steps, reread your begining mats. #You can use %s for strings, %d for data and %r (iirc) for raw input shit. #The .lower() function I called on bother the %firstName, and firstName basically took your raw_input and shoved it in lower case so it's not sensitives then spit it back out in lower (in the %firstName)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question