Login
|
Signup
langref.org
-
python
and
clojure
add..
all
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
php
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Structure
Conditionals
Perform different actions depending on several boolean conditions (IF .. THEN .. ELSIF .. ELSE)
python
if age > 84:
print 'You are really ancient'
elif age > 30:
print 'You are middle-aged'
else:
print 'You are young'
if age > 84:
print 'You are really ancient'
elif age > 30:
print 'You are middle-aged'
else:
print 'You are young'
clojure
(println
(condp <= age
84 "You are really ancient"
30 "You are middle aged"
"You are young"))
(println
(condp <= age
84 "You are really ancient"
30 "You are middle aged"
"You are young"))
Submit a new solution for
python
or
clojure
There are 20 other solutions in
additional
languages (
cpp
,
csharp
,
erlang
,
fantom
...)