That’s it! You can find my other projects on GitHub, including the code for Argo itself and DashTen.
goodbyes = map(
lambda x: x.capitalize(),
["au revoir", "ciao", "goodbye"])
name = input("What is your name? ")
def sayGoodbye(name, goodbye):
return goodbye + ", " + name + "."
for goodbye in goodbyes:
print(sayGoodbye(name, goodbye))
print("Again, au revoir! π")
# Output:
#> What is your name? <name>
#> Au revoir, <name>.
#> Ciao, <name>.
#> Goodbye, <name>
#> Again, au revoir! π
import qualified Data.Char as Char
capitalizeHead :: String -> String
capitalizeHead (x:xs) = Char.toUpper x : xs
goodbyes :: [String]
goodbyes =
map
capitalizeHead
["au revoir", "ciao", "goodbye"]
sayGoodbye :: String -> String -> String
sayGoodbye name = (++ ", " ++ name ++ ".")
main :: IO ()
main = do
putStr "What is your name? "
name <- getLine
sequence $
map
putStrLn
(map (sayGoodbye name) goodbyes)
putStrLn "Again, au revoir! π"
pure ()
-- Output:
-- > What is your name? <name>
-- > Au revoir, <name>.
-- > Ciao, <name>.
-- > Goodbye, <name>
-- > Again, au revoir! π
Au revoir! π