Linked Questions

-1 votes
3 answers
25k views

I am building a program that gets a password as a string and checks its strength by a couple of factors. I want to check if the entered string contains a special character (like %,,ドル# etc.) but so far ...
0 votes
2 answers
174 views

Is there a way shorter way to check for characters in a string? Thanks :D check = input("Put in the letter: ") word = "word" if(check == word[0]): print(check) if(check == word[1]): print(...
Ziggster's user avatar
-1 votes
2 answers
233 views

#!/usr/bin/python def split(x): return [char for char in x] def func(x): a = [] a.append(split(x)) for i in a: if a[i]== "\"": print ("hw") str = "string\"" print (...
ccvhd's user avatar
  • 202
0 votes
3 answers
283 views

I am coding a simple program in which I would like to have the user input a string and then my code will check from another string of characters (that are not allowed in the string). The string of ...
1 vote
2 answers
132 views

I am a totally new programmer, learning python for the first time so sorry if my question isn't very clear and I am not using the correct computer science terminology. What I am trying to do is count ...
cs_newbie's user avatar
1 vote
2 answers
134 views

My code below only prints "Remove Special Character". but if i leave only ("#"), it runs very well. def name_character(word=input("Username: ")): if ("#") or ("$") or ("&") in word: ...
Albert's user avatar
  • 13
0 votes
0 answers
30 views

I need to check if spaces on my board are empty. It will return True if there are no more available spaces. Here is my code: # # File: done.py # Purpose: Complete the code in the function "done&...
Jiggs's user avatar
  • 1
3585 votes
10 answers
7.5m views

I'm looking for a string.contains or string.indexof method in Python. I want to do: if not somestring.contains("blah"): continue
8 votes
4 answers
137k views

How do I print a specific character from a string in Python? I am still learning and now trying to make a hangman like program. The idea is that the user enters one character, and if it is in the word,...
EVARATE's user avatar
  • 135
4 votes
5 answers
3k views

I have a string like below in python testing_abc I want to split string based on _ and extract the 2 element I have done like below split_string = string.split('_')[1] I am getting the correct ...
nmr's user avatar
  • 763
-1 votes
3 answers
17k views

I am wondering how to check a string for certain letters to attach values to them so I can add them up, then return the total to the user. How would I go with doing so?
genieSessions's user avatar
-2 votes
3 answers
6k views

If I want to know whether some characters are found in a string, how? String will be returned as Boolean. The body is as below : Return True if the letters 'A', 'T', 'C' or 'G' are found in the ...
-1 votes
2 answers
2k views

I am wanting to create an Algorithm that creates a 20 digit number code. Similar to how gift card codes are created. I would like to use python for it, since I know python the best out of ALL ...
1 vote
4 answers
943 views

I'm trying to create a hangman game with python. I know there is still a lot to complete but I'm trying to figure out the main component of the game which is how to compare the user inputted string (...
user avatar
0 votes
4 answers
234 views

How to check a string for specific characters? I find the link is very useful. But what's wrong with my codes? string = "A17_B_C_S.txt" if ("M.txt" and "17") in string: print True else: ...
Shengen's user avatar
  • 73

15 30 50 per page
1
2