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
I am struggling with my computer science class and need to create a code in python that can add subtract or quit user imputs,
def main():
input1 = eval(input("Enter first value:"))
input2 = eval(input("Enter second value:"))
A = eval(input("Select [A]dd, [S]ubtract or [Q]uit:"))
if A =="S":
input1 + input2
main()
This is what i have so far
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 3 steps with 1 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 c++ program that will ask the user to enter integer. The dialog box should look like below. Note: Use looping (array if needed) . Include program annotation.arrow_forwardhelp me solve this in c++ please Write a program that asks the user to enter a list of numbers from 1 to 9 in random order, creates and displays the corresponding 3 by 3 square, and determines whether the resulting square is a Lo Shu Magic Square. Notes Create the square by filling the numbers entered from left to right, top to bottom. Input validation - Do not accept numbers outside the range. Do not accept repeats. Must use two-dimensional arrays in the implementation. Functional decomposition — Program should rely on functions that are consistent with the algorithm.arrow_forwardIn python, what does the following function do? Fill out the docstring description for the function (the first line).arrow_forward
- What happens if the statement free(a) is removed in the following C code? int *a; a=(int*)malloc(sizeof(int)); *a=100; printf("*a%d",*a); free(a); Question 4 options: Error Memory Leak Dangling Pointers Segmentation Faultarrow_forwardPython (this is not graded this is practice work that is not graded) write and test a function which takes two dates (month, day) list arguments.When the function is called with the two arguments, it returns the number of days betweenthose two dates. Print the returned value. It is assumed that the first date occurs first. Forinstance, if the users calls the function with FUNCTION([12, 10], [12, 20]) as arguments, thereturned value is 10 days. However, if FUNCTION([12, 20], [12, 10]) is called, the returnedvalue is -10 days.Assume February has 28 days.Test data: [10, 30], [5, 20] [1, 30], [5, 25] [5, 25], [1, 30] [1, 1], [12, 31]arrow_forwardHello, I am struggling with getting this DICE GAME to function properly. I have made an attempt to try and get the overall program to debug and run without errors, but to no avail. If I can get some help getting my PYTHON program to Run Correctly. #Lab 7-3 The Dice Game #add libraries needed playerTwo = 'NO NAME' playerOne = 'NO NAME' inputNames = ("enter name") import random #the main function def main(): print #initialize variables endProgram = "no" playerOne = "NO NAME" playerTwo = "NO NAME" #call to inputNames playerOne, playerTwo = inputNames(playerOne, playerTwo) #while loop to run program again while "endProgram" == 'no': #initialize variables p1number = 0 p2number = 0 winnerName = 'NO NAME' #call to rollDice winnerName = "rollDice"(p1number, p2number, playerOne, playerTwo, winnerName) #call to displayInfo displayInfo: ("winnerName") #end of while loop endProgram = "raw_input"('Do you want to end program?(Enter yes…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