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
please code in python
Use a single comprehension to make a list of the square numbers below 100 that give a remainder of 1 when divided by 3.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
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
- write a python code:arrow_forwardIn python, The function decodeFromAscii takes a list L of integers in the range 32 through 126. Each item in L is an ASCII code representing a single printable character. The function accumulates the string of characters represented by the list of ASCII codes and returns that string. For example, decodeFromAscii([78, 105, 99, 101, 33]) returns "Nice!" because N is chr(78), i is chr(105), c is chr(99), etc. Note: ASCII was created in the 1960's so programmers could have a standard encoding for common keyboard characters as numbers. It was later expanded to create Unicode so that characters from languages other than English, mathematical symbols, and many other symbols could also be represented by numerical codes. For example: Test Result print(decodeFromAscii([36, 49, 44, 48, 48, 48])) $1,000 print(decodeFromAscii([115, 110, 111, 119])) snowarrow_forwardPython Language] Using loops of any kind, lists, or is not allowed. At the Academy of Crime Fighting, each trainee is recognized by a unique 5-digit identifier. The identifier can have any of the following digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. The identifier can have leading 0s. Since Drew the owl has trouble typing numbers, the school makes things easier by ensuring that each successive digit in the identifier is either one digit greater or one digit less than the previous digit. For example, if the first digit is 3, then the successive digit would be 4 or 2. So, 32345 would be a valid trainee identifier, but 32435 would NOT be a valid identifier because the third digit 4 is two digits away from the previous digit 2. Your task is to write a program that validates an identifier. Input The input consists of five lines; the first line is the first digit of the trainee identifier, the second line is the second digit of the trainee identifier, and so on. Output If the trainee identifier is…arrow_forward
- Please answer in pythonarrow_forwardPlease only do rec_sum_digits function in python using only recursive and no looparrow_forwardPython please Use map(s) to program this formula: Σ [ (xi – x)(yi – y) ] / Σ [ (xi – x)^2] Note the Σ symbol means "SUM" where the sum goes from 0 to a limit. And the ^2 at the end of the equation means 'squared'.arrow_forward
- Greatest Common Divisor Two integers A and B have the greatest common divisor which is the largest positive integer that divides A and B, evenly, without a remainder. One way to find the Greatest Common Divisor is to consider the prime factors for A = 372 and B = 84 as shown below. 372 223 * 31 84 22*3*7 GCD (372,84) = 2²*3= 12 In a well-documented Python program, hmwk3Q3.py, query the user for two integers. Use a while-loop to find the remainder R when dividing A by B.Replace the value of A with the value of B and replace the value of B with the value of R.Continue this process within the while-loop until the value of B is zero. At that time the value of A will be the GCD. In a comment, provide the response to your program when A= 98,025,733,547 and B = 2,345,109,894,323.arrow_forwardplease code in python Write a recursive function to add a positive integer b to another number a, add(a, b), where only the unit 1 can be added, For example add(5, 9) will return 14. The pseudocode is: # Base case: if b is 1, you can just return a + 1 # General case: otherwise, return the sum of 1 and what is returned by adding a and b - 1.arrow_forwardSolve using python make sure your code is correct please Assume the variable temps has been assigned a list that contains floating-point values representing temperatures. Write code that calculates the average temperature and assign it to a variable named avg_temp . Besides temps and avg_temp , you may use two other variables -- k and total .arrow_forward
- Code a Python List that displays the name of the months with 31 days only.arrow_forwardplease code in pythonSuppose you record a list of birthdays for your classmates, recorded as month day tuples. An example is given below. # The 2nd to last tuple needs the int(2) in it so that it is uniquely stored in memory compared to (2,8)# Under the hood Python 3.7 changed how these are stored so (2,8) and (2,8) are stored in the same location# and then the algorithm below doesn't work dates = [(3,14),(2,8),(10,25),(5,17),(3,2),(7,25),(4,30),(8,7),(int(2),8),(1,22),(2, int(8))]You read about the famous birthday problem and you become interested in the number of pairs of classmates that share the same birthday. Below is an algorithm you write to do this. (Note: the is operator tests that two operands point to the same object) def birthday_original(dates_list): count = 0 for person_a in dates_list: for person_b in dates_list: # Make sure we have different people if person_a is person_b: continue # Check both…arrow_forward##### solve this with in 15 mins###### Question: 1A Special Number is a number when the sum of the factorial of digits is equal to the original number (given number). For example, 145 is a Special Number because 145 = 1! + 4! + 5!.Your task is to write a Python code that takes some numbers as user input (separated by a comma) in a single line and groups the Special & Non-Special numbers in a dictionary. Note that the values corresponding to the keys in that dictionary must be in tuple format.Sample Input 1:145, 346, 2, 83221, 7999888Sample Output 1:{'Special': (145, 2), 'Non-Special': (346, 83221, 7999888 )}-----------------------------------------------------------------Sample Input 2:1431, 69716, 353, 7969828Sample Output 2:{'Special': (), 'Non-Special': (1431, 69716, 353, 7969828)}arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
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