This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.pathutils | |
import android.content.ContentUris; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Environment; | |
import android.provider.DocumentsContract; | |
import android.provider.MediaStore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Write a program to print all odd numbers Between 1 to 100. | |
# Take count | |
count = 1 | |
# Run while loop from 1 to 100 | |
while count <= 100: | |
# Check if number is odd and print it in console | |
if count % 2 != 0: | |
print(count) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Take input from user, test whether it is even or odd | |
# Take input | |
number = eval(input("Enter a number : ")) | |
# Check if number is even or odd | |
if number % 2 == 0: | |
print("It is an even number") | |
else: | |
print("It is an odd number") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ######################################################### | |
# Question 1. | |
# Get two number from user | |
input1 = eval(input("Enter number 1 : ")) | |
input2 = eval(input("Enter number 2 : ")) | |
# Check which number is greater | |
if input1 > input2: | |
print(input1, " is greater.") | |
elif input1 < input2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Take two global values to perform all operations in this program | |
value1 = eval(input("Enter first integer value : ")) | |
value2 = eval(input("Enter second integer value : ")) | |
# Question 1. Create a program to Subtract two or more values | |
print(value1, " - ", value2, " = ", value1 - value2) | |
# Question 2. Create a program to Multiply two or more values | |
print(value1, " * ", value2, " = ", value1 * value2) |