0

In C# I would do this if I wanted the word 'Many' to display if the count was 10 or more:

int count = 10;
var result = count < 10 ? count : "Many";

How do you do this in python?

Jonathan Kittell
  • 6,475
  • 13
  • 48
  • 87

1 Answers1

1

Simply use print function and if-else statement:

>>> count =10
>>> print('many') if count>=10 else ''
many
Mazdak
  • 100,514
  • 17
  • 155
  • 179