Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print values
#1
As per my understanding if we want to add two strings and print then we should use comma .

e.g print('abc','def') = > this will give abcdef

But in this python code below we are not using comma but a "+"
classmates = {'Tony': ' cool but smells', 'Emma': ' sits behind me', 'Lucy': ' asks too many questions'}

for k, v in classmates.items():
    print(k + v)
Here we are using "+" in print ..instead of "comma" ...Is it correct ?
Reply


Messages In This Thread
print values - by volcano - Feb-24-2018, 05:13 AM
RE: print values - by largecat - Feb-24-2018, 06:43 AM
RE: print values - by wavic - Feb-24-2018, 07:22 AM
RE: print values - by snippsat - Feb-24-2018, 02:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Print names in x-axis of a time-series values hobbyist 4 1,303 Apr-22-2023, 09:29 PM
Last Post: deanhystad
Question How to print each possible permutation in a dictionary that has arrays as values? noahverner1995 2 1,820 Dec-27-2021, 03:43 AM
Last Post: noahverner1995
  Print variable values from a list of variables xnightwingx 3 2,701 Sep-01-2020, 02:56 PM
Last Post: deanhystad
  Unable to print the exact Float values when I convert LIST to Sequence of Tuples? preethamalluri 1 2,515 Jul-12-2018, 09:03 AM
Last Post: buran
  print 3 return values from function bluefrog 5 5,348 Mar-05-2017, 07:58 PM
Last Post: wavic

Forum Jump:

User Panel Messages

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