Python Forum
Why can't this code work.
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why can't this code work.
#2
Python won't let you accidentally change a global variable from a function. There is a way to simply modify the global variable, however it's discouraged generally speaking and very heavily on this particular site.

As for what you're really trying to accomplish here... it looks like this is homework. Can you specify the requirements?
Reply


Messages In This Thread
Why can't this code work. - by sexualpanda - Feb-05-2017, 06:14 PM
RE: Why can't this code work. - by micseydel - Feb-05-2017, 06:54 PM
RE: Why can't this code work. - by ichabod801 - Feb-06-2017, 04:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  my simple code wont work! help! simon12323121 2 2,067 Sep-05-2021, 09:06 AM
Last Post: naughtyCat
  My code does not work as expected (pygame) rohes_kaugummi 1 1,620 Aug-26-2021, 03:13 PM
Last Post: deanhystad
  I wrote a code but it does not work out as expected chinitayao226 2 1,918 Sep-23-2020, 09:14 PM
Last Post: SnowwyWolf
  A program for backing up documents (doesnt work(code is inside)) Richard_SS 4 3,491 Jun-05-2019, 03:47 PM
Last Post: heiner55
  I Can't Get This Sorting Function In This LinkedList Code To Work JayJayOi 10 8,065 Jan-11-2018, 01:14 AM
Last Post: JayJayOi
  Need help with getting this voting eligiblity code to work Beastly 1 2,567 Aug-16-2017, 03:46 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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