Python Forum
Code isn't working in several IDE's when other people are getting desired output.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code isn't working in several IDE's when other people are getting desired output.
#1
my question here

names = ["daken" , "deadpool" , "elixir" , "cypher" ]

you = names.pop(0)

v = str(input('Enter a question'))

if v == "Who am I ? ":
    print("You are" , you )

else:
    print("You're irrelevant") 
don't comment on my coding i am not trynna achieve anything just trynna understand what the various statements and methods do. I have tried the code in aptana, pyscripter and pycharm none of them give me output but say syntax error and pycharm automatically prints else. strangely pyfiddle gets output. Weird. Please help.
Reply
#2
Runs for me, you do realize that the question must be verbatim,
including the ? and all spaces in order to execute if condition right?

You should show the actual error message (in it's entirety) as you should not get a syntax error
If you have this in a loop, it will fail after the list is exhausted (item is removed from list with pop
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in output of a snippet code akbarza 2 300 Feb-28-2024, 07:15 PM
Last Post: deanhystad
  New to Python - Not sure why this code isn't working - Any help appreciated TheGreatNinx 4 908 Jul-22-2023, 10:21 PM
Last Post: Pedroski55
  code not working when executed from flask app ThomasDC 1 834 Jul-18-2023, 07:16 AM
Last Post: ThomasDC
  I cannot able to see output of this code ted 1 715 Feb-22-2023, 09:43 PM
Last Post: deanhystad
  I am new to python and Could someone please explain how this below code is working? kartheekdas 2 970 Dec-19-2022, 05:24 PM
Last Post: kartheekdas
  How do I scrape profile information from Twitter People search results? asdad 0 704 Nov-29-2022, 10:25 AM
Last Post: asdad
  Json filter is not capturing desired key/element mrapple2020 1 1,073 Nov-24-2022, 09:22 AM
Last Post: ibreeden
Exclamation My code is not working as I expected and I don't know why! Marinho 4 1,030 Oct-13-2022, 08:09 PM
Last Post: deanhystad
  why I dont get any output from this code William369 2 1,084 Jun-23-2022, 09:18 PM
Last Post: William369
  My Code isn't working... End3r 4 1,862 Mar-21-2022, 10:12 AM
Last Post: End3r

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020