Jump to content

User Input

From Slow Like Wiki
Revision as of 14:23, 3 April 2024 by Rob (talk | contribs) (Created page with "== Using input() == <syntaxhighlight lang="python" line> secret = input("Tell me a secret. I promise I won't repeat it: ") print(f"Your secret was '{secret}'. Oops, sorry!") </syntaxhighlight> <syntaxhighlight lang="python" line> </syntaxhighlight> <syntaxhighlight lang="python" line> </syntaxhighlight> <syntaxhighlight lang="python" line> </syntaxhighlight> <syntaxhighlight lang="python" line> </syntaxhighlight> <syntaxhighlight lang="python" line> </syntaxhighlight>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Using input()


secret = input("Tell me a secret. I promise I won't repeat it: ")
print(f"Your secret was '{secret}'. Oops, sorry!")