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

Why does this line of code occur ?

  • 5 May 2019
  • 1 reply
  • 44 views

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

Reply