Computer Science
Evaluate the expression given below if A = 16 and B = 15.
A % B // A
- 0.0
- 0
- 1.0
- 1
Python Funda
2 Likes
Answer
0
Reason — According to operator precedence, floor division (//) and remainder (%) both have equal precedence hence the expression will be evaluated from left to right.
A % B // A
= 16 % 15 // 16
= 1 // 16
= 0
Answered By
1 Like
Related Questions
Write a program that reads a date as an integer in the format MMDDYYYY. The program will call a function that prints print out the date in the format <Month Name> <day>, <year>.
Sample run :
Enter date : 12252019 December 25, 2019Write a program that prints a table on two columns — table that helps converting miles into kilometres.
Write another program printing a table with two columns that helps convert pounds in kilograms.
Write a program that reads two times in military format (0900, 1730) and prints the number of hours and minutes between the two times.
A sample run is being given below :
Please enter the first time : 0900 Please enter the second time : 1730 8 hours 30 minutes