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
  • 5,833
  • 12
  • 42
  • 79

1 Answers1

1

Simply use print function and if-else statement:

>>> count =10
>>> print('many') if count>=10 else ''
many
kasravnd
  • 94,640
  • 16
  • 137
  • 166