From 1b82e7a8f882b2a0d84de79237e09c0b7096b0e0 Mon Sep 17 00:00:00 2001 From: sid-jOkEr Date: Mon, 21 Oct 2019 23:36:11 +0530 Subject: [PATCH] corrections in the code --- 2 - Print/coding_challenge.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/2 - Print/coding_challenge.py b/2 - Print/coding_challenge.py index 50b79e8c..370fcb7b 100644 --- a/2 - Print/coding_challenge.py +++ b/2 - Print/coding_challenge.py @@ -4,12 +4,26 @@ # print the message print('Why won't this line of code print') +# As there is a single quote which will throw an error of invalid syntax. +# We will have to escape the single quote using \ +print('Why won\'t this line of code print') + # print the message prnit('This line fails too!') +# The function being used here is print +print('This line fails too!') + # print the message print "I think I know how to fix this one" +# Missing parenthesis to call print +print ("I think I know how to fix this one") + # print the name entered by the user input('Please tell me your name: ') print(name) + +# We need to store the String (name) in a variable +name = input('Please tell me your name: ') +print(name)