Python Forum
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Symbols in a String
#3
(Apr-05-2017, 09:41 AM)MeMeBigBoy Wrote: I am a student and I am currently working on a password scoring program, I need to find a way to identify whether the password entered (the string) contains symbols such as: !, £, $, %, ^, &, * etc.

Any help would be greatly appreciated. Thank you.

symbols = "~`!@#$%^&*()/_-+={}[]:>;',</?*-+"

contains_symbol = False
for symbols in symbols:
    if symbols in pw1:
      contains_symbol = True
      Score+=10
      break
print(contains_symbol)
Reply


Messages In This Thread
Symbols in a String - by MeMeBigBoy - Apr-05-2017, 09:41 AM
RE: Symbols in a String - by j.crater - Apr-05-2017, 09:43 AM
RE: Symbols in a String - by gullidog - Apr-05-2017, 09:48 AM
RE: Symbols in a String - by MeMeBigBoy - Apr-05-2017, 09:50 AM
RE: Symbols in a String - by garfield - Apr-05-2017, 11:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python script that deletes symbols in plain text nzcan 3 753 Sep-05-2023, 04:03 PM
Last Post: deanhystad
  cyrillic symbols in tables in reportlab. hiroz 5 11,804 Sep-10-2020, 04:57 AM
Last Post: bradmalcom
  Unexpected output: symbols for derivative not being displayed saucerdesigner 0 2,115 Jun-22-2020, 10:06 PM
Last Post: saucerdesigner
  Replacing symbols by " Tiihu 1 1,943 Feb-13-2020, 09:27 PM
Last Post: Larz60+
  How do I delete symbols in a list of strings? Than999 1 2,346 Nov-16-2019, 09:37 PM
Last Post: ibreeden
  Python symbols AND letters gullidog 1 3,548 Apr-05-2017, 10:13 PM
Last Post: ichabod801
  Strings containing both symbols and letters gullidog 13 8,459 Apr-05-2017, 12:27 PM
Last Post: ankit
  Symbols Distinguished From Letters? MeMeBigBoy 3 3,961 Apr-05-2017, 12:21 PM
Last Post: wavic
  How to get pyhton to identify symbols in a string MemeLord15 4 4,420 Apr-05-2017, 11:14 AM
Last Post: wavic

Forum Jump:

User Panel Messages

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