Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How i can judge my code
#3
(Oct-02-2019, 06:02 AM)buran Wrote: I don't know about other members, but for me it's not clear what you try to do. Also, what strTargetData is? What does "judge my code/string" means?
strTargetData is i write wrong info actaully i want to write mystring not strTargetData
Good Day,

the question I would like to ask is I can judge in (mystring = "1111111111100000000000") every single position. and want use 1 to judge.

for example

myjudge = "1"
mystring = "1111111111100000000000"
mystring[1] #this is the code i judge my string position 1

if mystring == "myjudge":
print mystring = 1
else:
print mystring = 0
my output will get 1 if the judgment is correct else will judge 0

actually I want to write the code on the simple way but I am no ideal how can I write my code on complex way I total write 32 times to judge (mystring=1111111111100000000000) result


my output result is
1111111111100000000000



mystring[1] #this is the code i judge my string position 1

if mystring == "myjudge":
print mystring = 1
else:
print mystring = 0

I TOTAL WRITE THIS CODE 32 TIME

now I am thinking how I can use for loop to write the code or another simple way to write the code
Reply


Messages In This Thread
How i can judge my code - by christing - Oct-02-2019, 04:16 AM
RE: How i can judge my code - by buran - Oct-02-2019, 06:02 AM
RE: How i can judge my code - by christing - Oct-02-2019, 09:20 AM
RE: How i can judge my code - by CoderMan - Oct-02-2019, 09:24 AM
RE: How i can judge my code - by christing - Oct-02-2019, 12:32 PM
RE: How i can judge my code - by SheeppOSU - Oct-02-2019, 12:39 PM
RE: How i can judge my code - by christing - Oct-02-2019, 01:53 PM
RE: How i can judge my code - by ichabod801 - Oct-02-2019, 03:16 PM
RE: How i can judge my code - by christing - Oct-02-2019, 04:11 PM
RE: How i can judge my code - by jefsummers - Oct-02-2019, 04:48 PM
RE: How i can judge my code - by christing - Oct-02-2019, 05:50 PM
RE: How i can judge my code - by newbieAuggie2019 - Oct-02-2019, 06:33 PM
RE: How i can judge my code - by christing - Oct-03-2019, 09:38 AM
RE: How i can judge my code - by newbieAuggie2019 - Oct-03-2019, 02:23 PM
RE: How i can judge my code - by buran - Oct-02-2019, 06:46 PM
RE: How i can judge my code - by christing - Oct-03-2019, 12:33 AM
RE: How i can judge my code - by burningkrome - Oct-03-2019, 11:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can i judge 1st string position is correct number christing 3 2,531 Oct-30-2019, 03:32 AM
Last Post: newbieAuggie2019

Forum Jump:

User Panel Messages

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