
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question

Transcribed Image Text:Write a Python program that takes a list of integers
as input and returns a new list containing only the
even numbers from the input list.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 4 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- python code Write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs the smallest and largest integers in the list.arrow_forwardWrite a program in python which will read an integer k from standard input. Use the list function and the range function to print a list of the even integers from -10 up to k (inclusive). Notice the form of the output is a list. NOTE: If k is less than -10, your range command should automatically produce an empty sequence, resulting in an empty list being printed. See the provided examples. For example: Input Result 5 [-10, -8, -6, -4, -2, 0, 2, 4] -11 [] 11 [-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10] 2 [-10, -8, -6, -4, -2, 0, 2]arrow_forwardWrite a Python program that reads an integer N. After, read N inputs from the user and create a list of N items and print the list. Then remove the Empty strings from the list and print the new list. Sample Input: 8 hey there what's up ? Sample Output: Original List: ["hey", "there", " ", "what's", " ", "up", " ", "?"] Modified List: ["hey", "there", "what's", "up", "?"]arrow_forward
- How do I do this in python? Create a program that prints a list of words in random order. The program should print all the words and not repeat any.arrow_forwardplease code in python. Create a program that has takes in a string and uses list comprehension to generate a list where each character is listed, ordered, but if it’s a vowel (including y), it bleeps it out with a randomly generated special symbol. Then print the list with spaces between each of the elements.Input: CHICKENOutput: C H $ C K * Narrow_forwardPYTHON Develop a function that returns a list of all prime numbers less than or equal to an input integer n (not including 1). Also, it calls a subroutine isprime(x) which checks if input "x" is prime.arrow_forward
- Task 2 Write a Python program that takes a list as an input from the user. Then creates a new list excluding the first and last two elements of the given list and prints the new list. If there are not enough elements in the list to do the task, the print "Not possible". Note: You may use list slicing. Sample Input 1: [10, 20, 24, 25, 26, 35, 70] Sample Output 1: [24, 25, 26] ============ Sample Input 2: [10, 20, 24, 25, 26] Sample Output 2: [24]arrow_forwardCreate a Python programme that reads a string list from the user and stores it in a dynamic array. The user should be able to insert as many pieces as they want and remove them as needed. Exemplify each sentence, please.arrow_forwardqweerarrow_forward
- Write a program that receives a list of integers and prints out that list after removing prime numbers from the list. Test your program with multiple lists of numbers and make sure it works properly. For instance, if the input is [1, 2, 3, 4, 5, 6, 7], it should print [1, 4, 6]. IN PYTHONarrow_forwardWrite a program in python which will read two integers, j and k, from standard input. Use the list function and the range function to print a list of integers from k down to j (inclusive). Notice the form of the output is a list. You may assume that j is less than or equal to k. For example: Input Result 2 5 [5, 4, 3, 2] 0 0 [0] -3 3 [3, 2, 1, 0, -1, -2, -3]arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education