Python Forum
Need help with lists to continue my assignment code
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with lists to continue my assignment code
#5
(Oct-07-2016, 11:05 PM)wavic Wrote: Do it once to append the site url and second time to append the encrypted password.

That would not end up with a list of lists that contains lists of 2 items, the website and the password
That would create a list like this
Output:
['website1', 'encryptedpassword1', 'website2', 'encryptedpassword2']
The list should end up looking like
Output:
[['website1', 'encryptedpassword1'], ['website2', 'encryptedpassword2']]
(Oct-07-2016, 10:53 PM)tinabina22 Wrote:
input = samplePasswordFile.append([website, encryptedPassword])
This is the error code I am getting with it:
Error:
input = samplePasswordFile.append([website, encryptedPassword]) NameError: name 'samplePasswordFile' is not defined
The error is because samplePasswordFile is not defined as pointed out by wavic, so define it like wavic showed
samplePasswordFile = []
when it does
samplePasswordFile.append([website, encryptedPassword])
the result does not need storing in input (which is a built in function so don't use it as a variable name) because it directly alters samplePasswordFile instead of returning an altered list.
Reply


Messages In This Thread
RE: Need help to continue my assignment code - by Yoriz - Oct-08-2016, 07:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  morse code assignment raymond2688 11 8,927 Jul-29-2019, 07:43 PM
Last Post: raymond2688
  Write pseudo code for a class assignment Scrimshot 3 3,547 May-07-2019, 05:38 PM
Last Post: Scrimshot
  Need some help with a bit of code for an assignment. JackMercer50 1 2,355 Feb-09-2019, 04:13 PM
Last Post: stullis
  [split] Need help with lists to continue my assignment code cylandur 7 9,766 Oct-11-2016, 03:11 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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