diff --git a/doc/Language/py-nutshell.pod6 b/doc/Language/py-nutshell.pod6 index 0f7d5f45c..b3f0f0f69 100644 --- a/doc/Language/py-nutshell.pod6 +++ b/doc/Language/py-nutshell.pod6 @@ -15,7 +15,7 @@ constructs and idioms. Let's start with printing "Hello, world!". L in Perl 6 is the equivalent of L in Python. Like Python 2, parentheses are -optional. A return is added to the end of the line. +optional. A return is added to the end of the line. Python 2 @@ -728,17 +728,21 @@ run on entering or leaving a block. =head2 X|Python> -In Python 3, the C keyword is used to prompt the user: +In Python 3, the C keyword is used to prompt the user. C can be +provided with an optional argument which is written to standard output without +a trailing newline: =begin code :lang -entered = input("Say hi → ") -print(entered) +user_input = input("Say hi → ") +print(user_input) =end code -When prompted, you can enter C or any other string, which will be stored in the C variable. This is similar to L in Perl 6: - my $entered = prompt(" Say hi → "); - say $entered # OUTPUT: whatever you entered. +When prompted, you can enter C or any other string, which will be stored +in the C variable. This is similar to L in Perl 6: + + my $user_input = prompt("Say hi → "); + say $user_input; # OUTPUT: whatever you entered. =end pod