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
  • 7,163
  • 15
  • 50
  • 93

1 Answers1

1

Simply use print function and if-else statement:

>>> count =10
>>> print('many') if count>=10 else ''
many
Mazdak
  • 105,000
  • 18
  • 159
  • 188