Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Programming for Everybody/Chapter 2/Assignment 2.2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
@author: atse
"""

name = input("Enter your name")
print("Hello %s" % name)
name = input("Enter your name: ") #taking input from user
print("Hello %s" % name) #printing the output with the input taken from user
8 changes: 4 additions & 4 deletions Python Data Structures/Chapter 7/Assignment 7.1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
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.