Computer Science with Python by Sumita Arora Solutions PDF: is what you might have searched for. This is Unit 1 namely Python Revision tour for class 12. Follow along for Sumita Arora Class 12 Python Solutions . You can print the page as PDF for future reference. Type C Questions from the book are covered.
Table of Contents
1. Write a program to print one of the words negative, zero, or positive, according to whether variable x is less than 0, 0, or greater than 0 respectively.
2. Write a program that returns True if the input number is an even number, False otherwise.
3. Write a Python program that calculates and prints the number of seconds in a year.
4. Write a Python program that accepts two integers from the user and prints a message saying if the first number is divisible by the second number or if it is not.
5. Write a program that asks the user the day number in the year in the range 2 to 365 and asks the first day of the year (e.g., Sunday, Monday, etc.), then the program should display the day on the day number that has been input.
6. One foot equals 12 inches. Write a function that accepts a length written in feet as an argument and returns this length written in inches. Write a second function that asks the user for a number of feet and returns this value. Write a third function that accepts a number of inches and displays this to the screen. Use these three functions to write a program that asks the user for a number of feet and tells them the corresponding number of inches.
7. Write a program that reads an integer N from the keyboard, computes, and displays the sum of numbers from N to (2N) if N is nonnegative. If N is a negative number, then it’s the sum of the numbers from (2N) to N. The starting and ending points are included in the sum.
8. Write a program that reads a date as integers in the format MMDDYYYY. The program will call a function that prints out the date in the format <month name> <day>,<year>.
9. Write a program that prints a table on two columns – a table that helps converting miles into kilometers.
10. Write another program printing a table with two columns that helps convert pounds into kilograms.
11. Write a program that reads two times in military format and prints the number of hours and minutes between the two times.
1. Write a program to print one of the words negative, zero, or positive, according to whether variable x is less than 0, 0, or greater than 0 respectively.
x = float ( input ( " Enter a number: " ))
if x < 0 :
print ( " Negative " )
elif x == 0 :
print ( " Zero " )
else :
print ( " Positive " )
Output Enter a number : 5
Positive
Pages:
1 2 3 4 5 6 7 8 9 10 11