Why does this line of code occur ? | Coursera Community
Coursera Header

Why does this line of code occur ?

Badge +3
if len(name) < 1 : name = "mbox-short.txt"
why does this line occur ?

Will the program work if that line is eliminated ?
because i feel that the file word count will be more than 1 anyway.

name = input("Enter file: ")

if len(name) < 1 : name = "mbox-short.txt"

name = "mbox-short.txt"
handle = open(name)
text = handle.read()

1 reply

Userlevel 7
Badge +12
Hi @Karun aditya. Have you tried posting your question in your course discussion forum? You'll likely get a quicker response there from other people who are taking the same course.


    Cookie policy

    We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

    Accept cookies Cookie settings