---
# System prepended metadata

title: Red Rum(250)
tags: [hacktober]

---

###### tags: `hacktober`

# Red Rum(250)

- 題目大意產生一段數字1到500，如果是3的倍數print red，如果是5的倍數print Rum，如果是15的倍數print Red Rum

- `print(','.join(['RedRum' if not (n%3 or n%5) else 'Red' if not n%3 else 'Rum' if not n%5 else str(n) for n in range(1,501)]))
`

```python=
MIN = 1
MAX = 500

for i in range(MIN,MAX+1):
    if i % 3 == 0 and i % 5 == 0:
        print('RedRum', end='')
    elif i % 3 == 0:
        print('Red', end='')
    elif i % 5 == 0:
        print('Rum', end='')
    else:
        print(str(i), end='')
    
    if i < MAX:
        print(',', end='')

print()
```

- `./rum.py | nc env2.hacktober.io 5000`