Skip to content

Instantly share code, notes, and snippets.

@mayankdawar
Created March 16, 2020 10:22
Show Gist options
  • Save mayankdawar/c070852f054da5bcdacd73d8317c822d to your computer and use it in GitHub Desktop.
Save mayankdawar/c070852f054da5bcdacd73d8317c822d to your computer and use it in GitHub Desktop.
Find the number of lines in the file, travel_plans2.txt, and assign it to the variable num_lines
#Find the number of lines in the file, travel_plans2.txt, and assign it to the variable num_lines.
file = open("travel_plans2.txt","r")
count = file.readlines()
num_lines = len(count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment