Question: Q2: Write the results of this coding: nums = list(range(7)) print(nums) print(nums[2:4]) print(nums[2:]) print(nums[:2]) print(nums[:]) print(nums[-5:-1]) nums[2:4] = [8, 9] print(nums) # Question-1 #

Q2: Write the results of this coding: nums = list(range (7)) print(nums) print(nums[2:41) print(nums[2:]) #


Q2: Write the results of this coding: nums = list(range(7)) print(nums) print(nums[2:4]) print(nums[2:]) print(nums[:2]) print(nums[:]) print(nums[-5:-1]) nums[2:4] = [8, 9] print(nums) # Question-1 # Question-2 # Question-3 # Question-4 # Question-5 # Question-6 # Question-7 Q3: Write the results of this coding: 1 = [1,2,5.1,'hi'] 1_1=[4,15,7] 1_2=1_1+1 I_2.append(8) >>print(l_2) Q4: X='Hello world' (note: there is one space between o and w). X[1:9:2] X[10:0:-3] X[8::-2] Q5: Please code to print out all elements in this list using the FOR statement: list_Sum = [[1,2,3],[4,5,6],[7,8,9]] Q6: Please code to print out each integer number from 5 to 10 using WHILE loop and IF statement. Q7: Please code to define a function to call the maximum value from this list: A=[1,2,3,4,5,7], and then please call the function to display the result.

Step by Step Solution

3.52 Rating (162 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Q2 python nums listrange7 printnums 0 1 2 3 4 5 6 printnums24 2 3 printnums2 2 3 4 5 6 prin... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!