Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def lainaa(quote, totuus = True):
- """Lainaa-funktio on kaksiparametrinen ja se palauttaa käyttäjän syötteen
- kaksinkertaisissa lainausmerkeissä, kun arvo on True ja
- yksinkertaisissa lainausmerkeissä, kun arvo on False. Paluuarvot ovat
- True kohdassa lainaa(quote, True) ja False kohdassa lainaa(quote, False)."""
- if totuus == True:
- quotetrue = '"' + quote + '"'
- return quotetrue
- elif totuus == False:
- quotefalse = "'" + quote + "'"
- return quotefalse
- def main():
- print("You say, I quote.")
- print("Please, say something:")
- quote = str(input())
- tuloste = lainaa(quote, True)
- print("You said:",tuloste)
- tuloste = lainaa(quote, False)
- print("You said:",tuloste)
- # Kutsutaan pääohjelmaa, jos ohjelmaa ajetaan.
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement