Pructor Python Quiz 7 by anupmaurya June 12, 2021 written by anupmaurya June 12, 2021 240 December 4, 2023 Welcome to your Pructor Python Quiz 5 Name Email What does the following Python3 code do? (using python 3.X version): n = int(input('Enter a number?'))i = 1while i <= n: i = i+1 print (i) a) Print all integers from 1 to n b) Print all integers from 1 to n-1 c) Print all integers from 2 to n d) Print all integers from 2 to n+1 What will the output of the following Python3 program (using python 3.X version)? n = 13sum = 0while (n> 1): n = n//2 sum = sum + nprint(sum) a) 2 b) 10 c) 9 d) Error What will the output of the following Python3 program? If the program has error, select the option ERROR (using python 3.X version): n,p = 9,1while (n >= 1): n,p = n//2,n*p print(int(p)) a) 8 b) 102 c) 9 36 72 72 d) Error The following code should print all positive even numbers less than or equal to N. N is taken as input from the user. What should replace the X for the code to work correctly?(using python 3.X version): int(input('Enter N:'))i = 1while ( i < N ) : if ( X ): print(i) i = i + 1 a) i//2 == 0 b) i%2 != 0 c) i//2 != 0 d) i%2 == 0 The following code should print all positive odd numbers less than or equal to N. N is taken as input from the user. What should replace the X for the code to work correctly? (using python 3.X version): N = int(input('Enter N:'))i = 1while ( i < N ) : print(i) X a) i = i + 2 b) i=i+3 Time's up 0 comment 0 FacebookTwitterPinterestEmail anupmaurya Hey there, My name is Anup Maurya. I was born with love with programming and worked with TCS. One of best global (IT) services and consulting company as System Administrator . I also love graphics designing. It's my pleasure to have you here. previous post Pructor Python Quiz 6 next post Pructor Python Quiz 1 Leave a Comment Cancel Reply Save my name, email, and website in this browser for the next time I comment.