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
what is the output of the following python program? [3 marks]
a=1
b=1
def fun1():
b=2
a=4
def fun2():
global a
nonlocal b
a=a+b
print (a,b) // first print
fun2()
print (a,b) // second print
fun1()
print(a,b) // third print
Expert Solution
arrow_forward
Step 1
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
Similar questions
- c/ c++ / Java / python - anything you like please give me witihn few minutes Im trying to write a program in python to find the smallest divisor of an integer.Take integer from userarrow_forwardC programmingarrow_forwardI'm trying to create a c program that will take in a ten-digit ISBN number and then check to see if the number is valid by calculating its weighted sum. This is the code that I have up to know, but I'm not sure what to do next. Can you give me some pointers? DOCUMENTATION-------------This program will determine if an ISBN number is valid by calculating its weighted sum.********************************************************************/#include <stdio.h>#include <stdbool.h> #define ISBN_SIZE 10#define MOD_NUM 11 void printInstructions(void);void getIsbn(int isbnArray[]);void printIsbn(int isbnArray[]);int calculateWeightedSum(int isbnArray[]);bool isIsbnValid(weightedSum);void printGoodbye(void); int main(){int isbnArray[ISBN_SIZE] = {0}; printInstructions();getIsbn(isbnArray); printf("\n\nThe ISBN ");printIsbn(isbnArray); if(isIsbnValid(calculateWeightedSum(isbnArray))){printf(" is valid.");}else{printf(" is not valid.");} printGoodbye(); return 0;}…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