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 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.