Clear it in 3 steps
-
Start the environment
-
Investigate the target
-
Submit the flag
In security work, programming is essential for processing large amounts of data. In this challenge, you'll use Python to read a file and find the flag. There's a file called "data.txt" with 100 lines of text, and it contains one flag. Complete and run this Python code: ```python # Open data.txt and read each line with open('data.txt', 'r') as file: for line in file: # Check if each line contains "FLAG{" if '____' in line: # Fill this in print(line.strip()) ```
Use an `if` statement to check if the line contains "FLAG{"
Use Python's `in` operator (e.g., `'apple' in 'apple pie'` → True)
Write `if 'FLAG{' in line:`