find

How to find if in created dictionary the chosen sequence has two aa letters?

How to find if in created dictionary the chosen sequence has two aa letters? Question: Lets say I have a dictionary. Is it possible to use the input function to enter the key and get the True for its specific value: dictionaryOne = { "ABCD" : "aatttgggtcatcg", "SSEE" : "atgcccgta", "GTAD" : "atgccggaaa" } I …

Total answers: 2

Python – Print on screen the letter in position "x"

Python – Print on screen the letter in position "x" Question: I need to find and print a letter of a word. For example: wOrd I want to print only the uppercase letter. I tried using "find()" it shows me the position of the letter but I can’t show the letter "O" it shows "1". …

Total answers: 3

Python: Find and increment a number in a string

Python: Find and increment a number in a string Question: I can’t find a solution to this, so I’m asking here. I have a string that consists of several lines and in the string I want to increase exactly one number by one. For example: [CENTER] [FONT=Courier New][COLOR=#00ffff][B][U][SIZE=4]{title}[/SIZE][/U][/B][/COLOR][/FONT] [IMG]{cover}[/IMG] [IMG]IMAGE[/IMG][/CENTER] [QUOTE] {description_de} [/QUOTE] [CENTER] [IMG]IMAGE[/IMG] …

Total answers: 2

How to use the find function to help replace a word in a sentence?

How to use the find function to help replace a word in a sentence? Question: I’m working on my Python homework of: Write a program that requests a sentence, a word in the sentence, and another word and then displays the sentence with the first word replaced by the second. The hint says to use …

Total answers: 2

Print all the "a" of a string on python

Print all the "a" of a string on python Question: I’m trying to print all the "a" or other characters from an input string. I’m trying it with the .find() function but just print one position of the characters. How do I print all the positions where is an specific character like "a" Asked By: …

Total answers: 3

Find and replace no updating values

Find and replace no updating values Question: I’m writing a script that combine csv into one and then do a find an replace for specific formatting and ask the user to correct the ones that not match. import glob import re import csv read_files = glob.glob("*.txt") final_file = ‘TABS3.ASC’ strformat1 = re.compile(r’d{3}.d{5}’) #combine all files …

Total answers: 1

Remove duplicates and keep row that certain column is Yes in a pandas dataframe

Remove duplicates and keep row that certain column is Yes in a pandas dataframe Question: I have a dataframe with duplicated values on column "ID", like this one: ID Name Street Birth Job Primary? 1 Fake1 Street1 2000-01-01 Job1 Yes 2 Fake2 Street2 2000-01-02 Job2 No 3 Fake3 Street3 2000-01-03 Job3 Yes 1 Fake1 Street1 …

Total answers: 3