Python Forum
TypeError: not enough arguments for format string
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: not enough arguments for format string
#5
(Jan-09-2022, 12:05 PM)MaartenRo Wrote: It restarts the shell. How can i get the script to make the multiple choice tests?
What do you mean? Your script generates files capitalsquiz1.txt through capitalsquiz35.txt and capitalsquiz_answers1.txt through capitalsquiz_answers35.txt. Did you want the program to ask you the questions? Well then you will have to add things. Use print(), input() and if.

And also: Larz60+ was right: you should not use the old-fashoned way to format strings. You had better use f-strings. They are much easyer to understand.
Reply


Messages In This Thread
RE: TypeError: not enough arguments for format string - by ibreeden - Jan-09-2022, 12:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: string indices must be integers deneme2 2 645 Feb-14-2025, 12:23 AM
Last Post: deneme2
  TypeError: string indices must be integers, not 'str' LEMA 2 2,454 Jun-12-2024, 09:32 PM
Last Post: LEMA
  boto3 - Error - TypeError: string indices must be integers kpatil 7 3,134 Jun-09-2023, 06:56 PM
Last Post: kpatil
  "TypeError: string indices must be integers, not 'str'" while not using any indices bul1t 2 5,928 Feb-11-2023, 07:03 PM
Last Post: deanhystad
  Set string in custom format korenron 4 2,021 Jan-16-2023, 07:46 PM
Last Post: mutantGOD
  Error TypeError: output_type_handler() takes 2 positional arguments but 6 were given paulo79 1 3,483 Oct-17-2022, 06:29 PM
Last Post: paulo79
  Format String NewPi 2 1,635 Oct-10-2022, 05:50 PM
Last Post: NewPi
  TypeError: string indices must be integers JonWayn 12 5,836 Aug-31-2022, 03:29 PM
Last Post: deanhystad
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 6,722 Jul-01-2022, 01:23 PM
Last Post: deanhystad
  Passing string functions as arguments Clunk_Head 3 2,102 Jun-15-2022, 06:00 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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