Wednesday, April 29, 2020

Change Values in the Dictionary in Python

In this article, I will show you how to change values the dictionary in Python programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



print()

MyFirstDictionary= {1: 'C++', 2: 'C', 3: 'Java',4:'JavaScript',5:'Python'}

print("\tChange Values in the Dictionary")

print()

print("\tOriginal Dictionary Values")

print()

print("\t",MyFirstDictionary)

print()

print("\tChange Dictionary Values")

results = MyFirstDictionary[4] = "Kotlin"

print()

print("\t",MyFirstDictionary)

print()

print("\tEnd of Program")

 

 

Accessing Items in the Dictionary in Python

In this article, I will show you how to access items in the dictionary in Python programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing


print()

MyFirstDictionary= {1: 'C++', 2: 'C', 3: 'Java',4:'JavaScript',5:'Python'}

print("\tAccessing Items in the Dictionary")

print()

print("\t",MyFirstDictionary)

results = MyFirstDictionary[5]

print()

print("\tYour have select {0} as your programming language."

      .format(results.upper()))

print()

print("\tEnd of Program")

 


Creation of Dictionary with its keys and values in Python

In this article, I will show you how to create of dictionary with its keys and values using Python programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



print()

MyFirstDictionary= {1: 'C++', 2: 'C', 3: 'Java',4:'JavaScript',5:'Python'}

print("\tCreating a Dictionary and Display its keys : values ")

print()

print("\t",MyFirstDictionary)

print()

print("\tEnd of Program")

 

 

Creating an empty Dictionary in Python

In this article, I will show you how to create an empty dictionary in Python programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



MyFirstDictionary= {}

print("Empty Dictionary: ")

print(MyFirstDictionary)

Tuesday, April 28, 2020

Decimal To Binary in Python


Write a program that will ask the user to input integer value and then the program will convert it into binary equivalent using the function.  The program also allows the user to run again the program by asking the user  "Do you want to continue? (Y/N) :”.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing


def convert_binary(values):
   if values > 1:
     convert_binary(values//2)
     print(values % 2,end ='');

def my_program():
   print();
   print("\tDECIMAL TO BINARY CONVERTER");
   print();
   decimal = int(input("\tEnter a Number: "));
   print();
   print('\tThe number {0} in Decimal is equivalent to '.format(decimal));
   convert_binary(decimal);
   print(" in binary.");
   print();
   repeat = input('\tDo you want to continue ? (Y/N) : ');

   if repeat.upper() == "N":
       print();
       print("\tEND OF PROGRAM");
       quit
   if repeat.upper() == "Y":
       my_program();

if __name__ == '__main__':
       my_program();


Positive and Negative Number Checker Using Function in Python


Write a program that will ask the user a number and then, the program will check if the given number by the user is a positive or negative number using a function.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing


def pos_neg(x):
    if x >= 0:
        print("\tThe given number %d is a POSITIVE number." % x)
    else:
        print("\tThe given number %d is a NEGATIVE number." % x)

print();
print("\tPositive and Negative Number Checker Using Function");
print();
x= int(input("\tGive a number : "));
display = x;
print();
pos_neg(display);
print();
print("\tEND OF PROGRAM");

Leap Year Checker Using Function Using Python


Write the program that will ask the user to input the year and then, the program will check and determine if the given year by the user is a leap year or not using the function. The program also asks the user if the user will continue using the program or not. If the user chooses Y for yes, the program will run again but if the user chooses N for no, the program will display a thankful message and return to the operating system.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



def leap_year(year):
    if year % 4 == 0 and year % 100 != 0:
        print("\tThe year %d is a Leap Year" % year)
    elif year % 100 == 0:
        print("\tThe year %d is not a Leap Year" % year)
    elif year % 400 == 0:
        print("\tThe year %d is a Leap Year" % year)
    else:
        print("\tThe year %d is not a Leap Year" % year)

def my_program():
    print();
    print("\tLeap Year Checker Using Function");
    print();
    a= int(input("\tGive a Year : "));
    display = a;
    print();
    leap_year(display);
    print();
    repeat = input('\tDo you want to continue ? (Y/N) : ')
    if repeat.upper() == "N":
        print()
        print("\tThank You For Using This Program.")
        print();
        print("\tEND OF PROGRAM");
        quit

    if repeat.upper() == "Y":
        my_program()

if __name__ == '__main__':
    my_program()


Cube a Number Using a Function in Python


Write a program that will ask the user to input integer value and then, the program will compute the cube value of the given number using a function and display the computed result on the screen.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing


def  cube(num):
            return (num*num*num)

print();
print("\tCube a Number Using a Function");
print();
number = int(input("\tGive a Number : "));
print();
print("\tThe cube value of {0} is {1}.".format(number, cube (number)));
print();
print("\tEND OF PROGRAM");

Temperature Converter in Python


Write a menu-driven program that uses a function to convert the following temperatures: Fahrenheit to Celsius and Kelvin, Celsius to Fahrenheit and Kelvin and Kelvin to Fahrenheit and Celsius. The program also has an exit program option in order for the user to quit the program.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing



def fah():
    print();
    F=int(input('\tEnter the temperature on Fahrenheit(F) : '));
    C=(F - 32) * 5/9;
    K=(F - 32) * 5/9 + 273.15;
    print();
    print("\tFahrenheit Value :",round(F,2));
    print("\tCelsius Value :",round(C,2));
    print("\tKelvin Value:",round(K,2));
    print();
    print("\tEND OF PROGRAM");

def cel():
    print();
    C=int(input('\tEnter the temperature on Celsius(C) : '));
    F=(C * 9/5) + 32;
    K=C + 273.15;
    print();
    print("\tFahrenheit Value :",round(F,2));
    print("\tCelsius Value :",round(C,2));
    print("\tKelvin Value:",round(K,2));
    print();
    print("\tEND OF PROGRAM");

def kel():
    print();
    K=int(input('\tEnter the temperature on Kelvin(K) : '));
    F=(K - 273.15) * 9/5 + 32;
    C=K - 273.15;
    print();
    print("\tFahrenheit Value :",round(F,2));
    print("\tCelsius Value :",round(C,2));
    print("\tKelvin Value:",round(K,2));
    print();
    print("\tEND OF PROGRAM");

print();
print("\t===== MAIN MENU =====");
print();
print("[1] Fahrenheit to Celsius & Kelvin");
print("[2] Celsius to Fahrenheit & Kelvin");
print("[3] Kelvin to Fahrenheit & Celsius");

Odd and Even Number Checker Using a Function in Python


Write a program that will ask the user to input an integer number and then, the program will check if the given number is odd or even using a function.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing


def is_odd_even(input_num):
    if input_num % 2 == 0:
        print();
        print("   ",input_num, "is EVEN number.");
    else:
        print();
        print("   ",input_num, "is ODD number.");
print();
print("\tOdd and Even Number Checker Using a Function");
print();
a = int(input("\tGive a Number : "));
is_odd_even(a);
print();
print("\tEND OF PROGRAM");

Fibonacci Numbers in Python


The program takes the number of terms and determines the Fibonacci series using recursion up to that term.


I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing




def fibonacci(n):
    if(n <= 1):
        return n
    else:
        return(fibonacci(n-1) + fibonacci(n-2))

print();
print("\tFibonacci Series Using Functions");
print();
n = int(input("\tEnter number of terms : "));
print();
print("\tFibonacci Sequence")
print();
for i in range(n):
 print('\t',fibonacci(i),end='');
print("\n");
print("\tEnd of Program”)

Simple Calculator in Python

I wrote this simple calculator in Python programming language while writing my own book and also to learn the language itself.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/

Program Listing


def menu():
    print();
    print("\t\t Simple Calculator Program");
    print();
    print("\tWritten By Jake R. Pompreada")
    print();
    print("\t1. Addition");
    print("\t2. Subtraction");
    print("\t3. Multiplication");
    print("\t4. Division");
    print("\t5. Quit Program");
    print();
    return int(input("\tChoose your option: "));


def add(a, b):
    print();
    print("\t",a, "+", b, "=", a + b);


def sub(a, b):
    print();
    print("\t",a, "-", b, "=", a - b);


def mul(a, b):
    print();
    print("\t",a, "*", b, "=", a * b);


def div(a, b):
    print();
    print("\t",a, "/", b, "=", a / b);


loop = 1
choice = 0
while loop == 1:
    choice = menu()
    if choice == 1:
        print();
        add(int(input("\tAdd this: ")), int(input("\tto this: ")))
    elif choice == 2:
        print();
        sub(int(input("\tSubtract this: ")), int(input("\tfrom this: ")))
    elif choice == 3:
        print();
        mul(int(input("\tMultiply this: ")), int(input("\tby this: ")))
    elif choice == 4:
        print("\n");
        div(int(input("\tDivide this: ")), int(input("\tby this: ")))
    elif choice == 5:
        loop = 0
print();
print("\tThank you for using this program.");
print();
print("\tEND OF PROGRAM");