Question

Write a script to create a list of 10 random integers. Create two more lists –one containing even elements from the original list, and the other containing odd elements from the original list. Use append() method to create first list and concatenation operator to create the second. Then display all the three lists.

Answer

Get the step-by-step solution for this question inside the Vidyadip app.

Get the answer in the app

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Write a function delrecord() to delete the record form the binary file “student”. The record should be deleted on the basis of student number.
Write the Pseudocode to sort the list using Selection sort – to sort a list A in ascending order
How to add an Index, row, or column to a Pandas DataFrame?
How to Delete Indices, Rows or Columns From a Pandas Data Frame?

Write definition of a function MSEARCH(STATES) to display all the state names from a list of STATES, which are starting with alphabet M.
For example:
If the list STATES contains

The following should get displayed
MP
MH
MZ
How can one protect from cyber fraud?
Write a program that accepts a sentence and calculate the number of upper case letters and lower case letters.
Suppose the following input is supplied to the program:
Python Programming SKILLS
Then, the output should be:
UPPER CASE 8
LOWER CASE 15
How to Rename the Index or Columns of a Pandas DataFrame?
Write a script to create a list of 10 random integers. Using the concept of slicing, create two more lists –one containing first five elements of the original list, and the other containing last 5 elements of the original list. Then display all the three lists.
Write a function AverageColumn() which accepts csv file as parameter. It will print sum and average of each row. For example if marks.csv contain 50,60,70,80,90 70,60,50,60,80 50,60,70,80,90 Then OUTPUT will be Sum is : 350.0 Average is : 116.66666666666667 Sum is : 320.0 Average is : 106.66666666666667 Sum is : 350.0 Average is : 175.0