<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=edge" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" / >
< title > SI16 - Learning how to walk while catwalking< / title >
<!-- style -->
< link rel = "stylesheet" href = "./static/css/variables.css" / >
< link rel = "stylesheet" href = "./static/css/global.css" / >
< link rel = "stylesheet" href = "./static/css/function.css" / >
<!-- script -->
< script src = "./static/js/lodash.js" > < / script >
< script src = "./static/js/spawnSticker.js" defer > < / script >
< script src = "https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js" > < / script >
< / head >
< body >
< section id = "sticker-container" > < / section >
< section id = "sticker-fix-container" > < / section >
< section class = "page--header" >
< header >
< h1 class = "title" > Shout< / h1 >
<!-- <h2 class="subtitle">Sub - - title</h2> -->
< / header >
< nav >
< a href = ".." data-sticker-fix = "Back" > < / a >
< a href = "/" data-sticker-fix = "Home" > < / a >
< / nav >
< / section >
< main class = "page--content" >
< div class = "description" >
Qui dolor voluptate nostrud laboris. Culpa laboris culpa velit ea. In commodo
eiusmod reprehenderit enim adipisicing.
< / div >
< div class = "function-io" >
< div class = "input" >
< h3 > Input< / h3 >
< ul >
< li > Text [str]< / li >
< li > Volume [int]< / li >
< / ul >
< / div >
< div class = "process" data-sticker = "Shout" > < / div >
< div class = "output" >
< h3 > Output< / h3 >
< ul >
< li > Shouted Text [str]< / li >
< / ul >
< / div >
< / div >
< div class = "endpoints" >
< h3 > Enpoints< / h3 >
< code >
https://hub.xpub.nl/soupboat/si16-app/api/shout/?text=< text> &volume=< volume>
< / code >
< div class = "example" > Example< / div >
< code > https://hub.xpub.nl/soupboat/si16-app/api/shout/?text=Hello& volume=5 < / code >
< / div >
< div class = "playground" >
< div class = "playground-input" >
< form
action="https://hub.xpub.nl/soupboat/si16-app/api/shout/"
id="playground"
class="input"
>
< h3 > Try it< / h3 >
< label for = "text" > Text< / label >
< input type = "text" name = "text" placeholder = "text" / >
< label for = "volume" > Volume< / label >
< input type = "number" name = "volume" / >
< input type = "submit" / >
< / form >
< / div >
< div class = "playground-output" >
< div class = "output" > < / div >
< / div >
< / div >
< div class = "notebook" >
<!-- <pre class="prettyprint">
< code class = "language-python" >
def shout(text: str, volume: int = 5) -> str:
"""Repeat the vowels in a string for a specified number of times"""
shouted_text = '' for c in text:
character = c
if c.lower() in ['a','e','i','o','u','y']:
character = character * volume
shouted_text = shouted_text + character
return shouted_text
< / code >
< / pre >
-->
< h1 > Repeat< / h1 >
< p > Repeat a string for a specified number of times< / p >
< pre > < code class = "language-python" > def repeat(text: str, times: int = 2) -> str:
"""Repeat a string for a specified number of times"""
return text * times
< / code > < / pre >
< p > < img alt = "ara repeating itself" src = "https://www.dienst.nl/sub/upload/images/1/30019_550.jpg" > < / p >
< p > This function has many attractive qualities, but its ability to repeat human speech is one that makes it truly unique among other types of companion python functions and one that has ensured its popularity for generations. You are likely to find, though, that the function's talents for mimicry still pales in comparison to the fact that it is charming, engaging, and truly remarkable. Here is one of the most popular repeating function so that you can appreciate more about what it has to offer. It often says injuries to people and computers. < / p >
< h2 > Examples< / h2 >
< p > The function takes a string as a parameter, and by default it repeats it twice. < / p >
< pre > < code class = "language-python" > repeat('hello')
< / code > < / pre >
< pre > < code > 'hellohello'< / code > < / pre >
< p > Eventually with a second parameter you can specify how many times you want it to repeats. < / p >
< pre > < code class = "language-python" > repeat('salut', 4)
< / code > < / pre >
< pre > < code > 'salutsalutsalutsalut'
< / code > < / pre >
< pre > < code class = "language-python" >
< / code > < / pre >
< / div >
< / div >
< / main >
< section class = "page--footer" >
< footer > Special Issue 16—Learning How to Walk while Catwalking< / footer >
< / section >
< / body >
< / html >