0

There is two data and printing the length of them. Code:

print(len(author),'\n',len(authorUnique))

and output:

5439 
 4443

I would like to get:

5439 
4443

What can I do to get what I want?

SunnyP
  • 3
  • 2

1 Answers1

2

Don't print them at once! It's much simpler to split this up into two separate print statements, which also solves your problem:

print(len(author))
print(len(authorUnique))

If you do only want to use one print statement, however, you need to specify the right separator token, like this:

print(len(author), len(authorUnique), sep='\n')
q9i
  • 168
  • 9
  • Thanks for both suggestions. And I wanted to know more about print(), so I wanted to do in one print statement. It works! – SunnyP Apr 10 '22 at 17:30