Python Forum
How to format characters that are given by user input with user input
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to format characters that are given by user input with user input
#1
I am writing a program (in Python 3.7.2) that is supposed to print out a flag with the width of the flag being user input and the characters used in the flag also being user input. I am having difficulty in formatting the characters according to user input. This is what I have so far:
Greeting = “Hi, I’m flaggy the flagmaker. Let’s make a flag!”
print (Greeting)
width = (int (input (“What’s the width of your flag?”)))
if width > 0:
     print (width)
elif width < 1:
     print (input( “What’s the width of your flag?\n>”))
characters = input (“What characters would you like to use?\n>”)
if characters == :
     print (input (“What characters would you like to use\n>?”))
print (format (characters3))
str = [’>width’]
print [str. format [“characters”]]
print [str. format [“characters”]]
print (format (characters3))
*my issues are in the third to last and second to last lines where I know the format is incorrect but I’m not sure how to correct it.
Reply


Messages In This Thread
How to format characters that are given by user input with user input - by i1928 - Feb-28-2019, 01:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Call CLI app with input? Winfried 5 539 May-23-2025, 07:52 PM
Last Post: snippsat
  Βad Input on line 12 Azdaghost 5 1,536 Apr-19-2025, 10:22 PM
Last Post: Azdaghost
  interactive process for input and output maiya 1 771 Mar-27-2025, 08:40 AM
Last Post: Gribouillis
  Warn user of validation error before they click submit robertkwild 1 1,029 Mar-12-2025, 03:49 AM
Last Post: Tishat73
  How to revert back to a previous line from user input Sharkenn64u 2 1,267 Dec-28-2024, 08:02 AM
Last Post: Pedroski55
  How to make it so whatever I input into a script gets outputted on a different file spermatozwario 4 1,351 Nov-24-2024, 12:58 PM
Last Post: deanhystad
Question [SOLVED] Same input different output antarling 2 1,073 Oct-25-2024, 11:28 PM
Last Post: antarling
  I think I need to delete input data because returning to start fails thelad 2 1,234 Sep-24-2024, 10:12 AM
Last Post: thelad
  Input function oldschool 1 848 Sep-14-2024, 01:02 PM
Last Post: deanhystad
  Handling receiving updates from user in Telebot mohsenamiri 0 1,704 Aug-26-2024, 09:25 AM
Last Post: mohsenamiri

Forum Jump:

User Panel Messages

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