Python Forum
Read from a file, get user input in a while loop
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read from a file, get user input in a while loop
#2
To get the first character of a string, you just use an index: text[0].

I think you want your while loop to be while counter + wrong < 9:. If that doesn't work, please clarify what is wrong with the while loop.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Read from a file, get user input in a while loop - by ichabod801 - Oct-24-2018, 02:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Connecting to Remote Server to read contents of a file ChaitanyaSharma 1 500 May-03-2024, 07:23 AM
Last Post: Pedroski55
  Help with to check an Input list data with a data read from an external source sacharyya 3 678 Mar-09-2024, 12:33 PM
Last Post: Pedroski55
  Recommended way to read/create PDF file? Winfried 3 3,160 Nov-26-2023, 07:51 AM
Last Post: Pedroski55
  python Read each xlsx file and write it into csv with pipe delimiter mg24 4 1,912 Nov-09-2023, 10:56 AM
Last Post: mg24
  WHILE LOOP NOT RETURNING USER INPUT AFTER ZerroDivisionError! HELP! ayodele_martins1 7 1,355 Oct-01-2023, 07:36 PM
Last Post: ayodele_martins1
  read file txt on my pc to telegram bot api Tupa 0 1,317 Jul-06-2023, 01:52 AM
Last Post: Tupa
  parse/read from file seperated by dots giovanne 5 1,319 Jun-26-2023, 12:26 PM
Last Post: DeaD_EyE
  Formatting a date time string read from a csv file DosAtPython 5 1,724 Jun-19-2023, 02:12 PM
Last Post: DosAtPython
  How do I read and write a binary file in Python? blackears 6 8,603 Jun-06-2023, 06:37 PM
Last Post: rajeshgk
  restrict user input to numerical values MCL169 2 1,091 Apr-08-2023, 05:40 PM
Last Post: MCL169

Forum Jump:

User Panel Messages

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