Navigation

    Cyberian
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Pro Blog
    • Users
    • Groups
    • Unsolved
    • Solved
    1. Home
    2. sweet friends
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 0
    • Groups 0

    sweet friends

    @sweet friends

    0
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    sweet friends Unfollow Follow

    Latest posts made by sweet friends

    • How to iterate over every n-th line from a file?

      I have a file called data.txt containing lines of data:

      This is line one
      This is line two 
      This is line three 
      This is line four 
      This is line five 
      This is line six 
      This is line seven
      

      …
      I have the following code:

      with open('data.txt', 'r') as f:
          for x, line in enumerate(f):
              if x == 3:
                  print(line)
      In this case it only prints
      

      “This is line four”.
      I do understand why but how do I take it from here and have it print the lines 4, 7, 10, 13, …?

      posted in Development Troubleshooting
      sweet friends
      sweet friends
    • RE: CS101 Lecture 1 Discussion

      Kindly give easy word defination of Computer Science, Programing, Graphics.

      posted in CS101- Introduction to Computer
      sweet friends
      sweet friends
    • RE: BT301 Lesson-1-14 Discussion

      Q What is Meant by Vitalism or Vital energy?

      posted in BT301 - Introduction to Biotechnology
      sweet friends
      sweet friends