From 55686c0dbc406709553b999113ddc8f34fd6ed7c Mon Sep 17 00:00:00 2001 From: nil001 <70965800+nil001@users.noreply.github.com> Date: Thu, 1 Oct 2020 13:35:57 +0530 Subject: [PATCH 1/2] Updated code and added comments for readability --- Programming for Everybody/Chapter 2/Assignment 2.2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Programming for Everybody/Chapter 2/Assignment 2.2.py b/Programming for Everybody/Chapter 2/Assignment 2.2.py index 7403564..d4b2732 100644 --- a/Programming for Everybody/Chapter 2/Assignment 2.2.py +++ b/Programming for Everybody/Chapter 2/Assignment 2.2.py @@ -5,5 +5,5 @@ @author: atse """ -name = input("Enter your name") -print("Hello %s" % name) \ No newline at end of file +name = input("Enter your name: ") #taking input from user +print("Hello %s" % name) #printing the output with the input taken from user From 752dca86a3115fc19e83351f581e1179cb34bd32 Mon Sep 17 00:00:00 2001 From: nil001 <70965800+nil001@users.noreply.github.com> Date: Thu, 1 Oct 2020 13:56:56 +0530 Subject: [PATCH 2/2] Update Assignment 7.1.py --- Python Data Structures/Chapter 7/Assignment 7.1.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Python Data Structures/Chapter 7/Assignment 7.1.py b/Python Data Structures/Chapter 7/Assignment 7.1.py index 77f9f66..e02d468 100644 --- a/Python Data Structures/Chapter 7/Assignment 7.1.py +++ b/Python Data Structures/Chapter 7/Assignment 7.1.py @@ -6,7 +6,7 @@ """ # Use words.txt as the file name -fname = input("Enter file name: ") -fh = open(fname) -a = fh.read() -print(a.upper().rstrip()) \ No newline at end of file +fname = input("Enter file name: ") #taking the user input and storing it in variable fname +fh = open(fname) #opening the file stored in fname +a = fh.read() #reading the file +print(a.upper().rstrip()) #rstrip() removes trailing characters and upper method makes the strig in uppercase.