Python Forum
hardest week yet: some guidence please
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hardest week yet: some guidence please
#20
I get that now but that leeds to my other issue is my code counting how many time a user name is used.


(Aug-18-2019, 06:44 PM)ndc85430 Wrote: First, you're printing the format method, not calling it. When you do call it, it takes multiple arguments, in the same order as the placeholders, e.g.

>>> "{} {} {}".format("foo", "bar", "baz")
'foo bar baz'
>>> 
Also, key will be assigned the values of the keys in the dict, so the expression key["name"] doesn't make any sense.

So I am thinking that my print statement should look like this with the exception that i need 2 keys or values 1 being the name the other number of attempts but I cant call for the number of attempts because I think it is not counting

            for key in intruder_log:
                print("Attackers tried {} times to log in as {}".format("name"))# i need to add my second {}
Reply


Messages In This Thread
RE: hardest week yet: some guidence please - by raymond2688 - Aug-18-2019, 06:48 PM
slice help - by raymond2688 - Aug-17-2019, 12:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calculating the number of day of the week RbaPhoenix 3 2,541 Mar-27-2020, 09:23 PM
Last Post: Larz60+
  week 1 python help - string formatting ? raymond2688 20 8,005 Jul-09-2019, 08:10 PM
Last Post: snippsat
  Trying to get the week number from a string of numbers fad3r 2 3,254 Apr-15-2018, 06:52 PM
Last Post: ljmetzger

Forum Jump:

User Panel Messages

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