Python Forum
break print_format lengthy line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
break print_format lengthy line
#1
hi
in the below snippet code :

info1={'name':'ali', 'classroom':3}
info2={'name':'mohammad','classroom':2}
print('{0[name]} is in  classroom {0[classroom]}.'.format(info1)) # 0 refers to info1
# note name and classroom in{} are without ''


print('{0[name]} is in  classroom {0[classroom]} and  {1[name]} is in  classroom {1[classroom]}.'.format(info1,info2))
# 0 refers to info1 and 1 refers to info2 .
how can break the lengthy last line(only with one format)?
thanks
Reply


Messages In This Thread
break print_format lengthy line - by akbarza - Mar-12-2024, 11:24 AM
RE: break print_format lengthy line - by snippsat - Mar-12-2024, 12:21 PM
RE: break print_format lengthy line - by Pedroski55 - Mar-12-2024, 03:26 PM
RE: break print_format lengthy line - by deanhystad - Mar-12-2024, 05:07 PM
RE: break print_format lengthy line - by akbarza - Mar-13-2024, 08:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  print a line break in writelines() method leodavinci1990 1 6,586 Oct-12-2020, 06:36 AM
Last Post: DeaD_EyE
  Regex won't replace character with line break Tomf96 2 2,631 Jan-12-2020, 12:14 PM
Last Post: Tomf96
  Break Line (For Debugging) vetabz 7 4,667 May-08-2017, 02:07 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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