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
  code isnt working. nezercat33 1 666 Mar-14-2025, 03:45 AM
Last Post: deanhystad
  Simple code not working properly tmv 2 530 Feb-28-2025, 09:27 PM
Last Post: deanhystad
  I'm new to Python - can someone help with this code as it is not working? lminc123 1 547 Feb-13-2025, 06:13 PM
Last Post: lminc123
  my code is not working erTurko 1 684 Nov-11-2024, 08:43 AM
Last Post: buran
  problem in output of a snippet code akbarza 2 1,280 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 2,366 Jul-22-2023, 10:21 PM
Last Post: Pedroski55
  code not working when executed from flask app ThomasDC 1 3,439 Jul-18-2023, 07:16 AM
Last Post: ThomasDC
  I cannot able to see output of this code ted 1 1,348 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 1,799 Dec-19-2022, 05:24 PM
Last Post: kartheekdas
  How do I scrape profile information from Twitter People search results? asdad 0 1,348 Nov-29-2022, 10:25 AM
Last Post: asdad

Forum Jump:

User Panel Messages

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