Question: do in python Task 2 1 Python Files solution.py * 1 # you can write to stderr for debugging purposes, e.g. 2 # sys.stderr.write(this is

do in python
Task 2 1 Python Files solution.py * 1 # you can write to stderr for debugging purposes, e.g. 2 # sys.stderr.write("this is a debug message ") task2 2 Write a function: 3 solution.py test-input.txt 4 def solution (N) 5 def solution (N): # write your code in Python 3.6 pass 6 7 that, given a positive integer N, prints the consecutive numbers from 1 to N, each on a separate line. However, any number which is a power of 2 should be replaced by the word POWER. For example, number 4 should be replaced by POWER, but number 5 should not. The function shouldn't return any value. Examples: Given N = 7, the function should print: POWER POWER 3 POWER 5 6 7 To leave editor use Ctrl +M Test Output Run Code Given N = 16, the function should print: % POWER POWER 3 POWER 5 6 7 POWER 9 10 11 12 ? All changes saved Any problems with the editor? Switch to basic editor Give Feedback | Task 2 1 Python Files solution.py * # you can write to stderr for debugging purposes, e.g. # sys.stderr.write("this is a debug message ") 1 2 task2 2 5 6 7 solution.py test-input.txt 3 4 Given N = 16, the function should print: 5 6 7 def solution(N): # write your code in Python 3.6 pass VO POWER POWER 3 POWER 5 6 7 POWER 9 10 11 12 13 14 15 POWER To leave editor use Ctrl + M = Test Output Run Code You can print a string to the output (without or with the end-of-line character) as follows: sys.stdout.write("sample string") sys.stdout.write("whole line ") Assume that: N is an integer within the range [1..1,000). In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment. + ) All changes saved Any problems with the editor? Switch to basic editor Give Feedback
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
