Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List operation error
#1
Hello everyone,
I recently registered in order to ask for help. Being a total newbie, I decided to practice with list operations, and I wanted to create a very simple program, simply using "append" and "pop".
random_list=[1, 2, 4, 8]
print(random_list.append("num"))
print(random_list.pop(1))
The bad news is, though, I'm not getting the output i wanted: while it should be [1, 2, 4, 8, "num"] and [1, 4, 8], what I get is:
None ; 2

What am I doing wrong?
Thanks in advance for your generous help, dear coders!
Reply


Messages In This Thread
List operation error - by Hermann_Fegelein - Aug-13-2018, 04:26 PM
RE: List operation error - by j.crater - Aug-13-2018, 04:39 PM
RE: List operation error - by buran - Aug-13-2018, 04:49 PM
RE: List operation error - by Hermann_Fegelein - Aug-13-2018, 05:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error in Matrix operation poorikanna 0 2,770 Oct-23-2017, 12:14 PM
Last Post: poorikanna

Forum Jump:

User Panel Messages

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