Python Forum
How can i judge 1st string position is correct number
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can i judge 1st string position is correct number
#1
May i ask. what function i can use to make me confirm my string position number one number if i get 1, i will get ok else i will get fail.

below is the function i using on my program

mystring = "11000000000000000000000000000000"
mystring[0:1]

if mystring == 1:
print(ok)
else:
print(fail)
Reply


Messages In This Thread
How can i judge 1st string position is correct number - by christing - Oct-29-2019, 04:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Extracting Version Number from a String britesc 2 1,117 May-31-2023, 10:20 AM
Last Post: britesc
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 4,930 Jul-01-2022, 01:23 PM
Last Post: deanhystad
  TypeError: int() argument must be a string, a bytes-like object or a number, not 'Non Anldra12 2 5,247 May-02-2021, 03:45 PM
Last Post: Anldra12
  cursor.execute: How to insert dynamic number in a string? stoeberhai 2 3,554 Mar-18-2021, 12:55 PM
Last Post: stoeberhai
  Regular expression: cannot find 1st number in a string Pavel_47 2 2,440 Jan-15-2021, 04:39 PM
Last Post: bowlofred
  Printing string at specific position on terminal - not showing __Mathieu__ 1 2,406 Sep-07-2020, 10:32 AM
Last Post: Larz60+
  Please support regex for version number (digits and dots) from a string Tecuma 4 3,228 Aug-17-2020, 09:59 AM
Last Post: Tecuma
  Make an array of string number in a List polantas 5 3,136 May-27-2020, 07:18 AM
Last Post: buran
  line number of first and second occurance of string in a file mdalireza 1 1,855 Nov-18-2019, 09:55 AM
Last Post: perfringo
  How i can judge my code christing 16 5,998 Oct-03-2019, 02:23 PM
Last Post: newbieAuggie2019

Forum Jump:

User Panel Messages

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