<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Onyeacholem Ifeanyi Joshua </title>
    <description>The latest articles on DEV Community by Onyeacholem Ifeanyi Joshua  (@gjeotech).</description>
    <link>https://dev.to/gjeotech</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F306704%2F563168bc-c297-4a9b-83e6-b7a8ae344cc0.jpg</url>
      <title>DEV Community: Onyeacholem Ifeanyi Joshua </title>
      <link>https://dev.to/gjeotech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gjeotech"/>
    <language>en</language>
    <item>
      <title>Creating and Managing User Accounts, Calculator &amp; Sending Notifications in Python</title>
      <dc:creator>Onyeacholem Ifeanyi Joshua </dc:creator>
      <pubDate>Wed, 05 Feb 2025 17:25:48 +0000</pubDate>
      <link>https://dev.to/gjeotech/creating-and-managing-user-accounts-calculator-sending-notifications-in-python-2hno</link>
      <guid>https://dev.to/gjeotech/creating-and-managing-user-accounts-calculator-sending-notifications-in-python-2hno</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;How to take inputs and validate them&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;We are starting by defining a function call welcomeNote&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def welcomNote():
    name = input('What is your name ? : ')
    print("Hello, {}, 'welcome to G-Jeotech Innovation Technology".format(name))
    print("Kindly fill in the details \n")
    return name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Here we are to get the name input be defining a new fun called profile&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def profile():
    year  = int(input('What is the current year? (eg. 2020) ?: '))
    age = int(input('What year were you born: ?'))
    location = input("Your current address? : ") 
    d_o_b = year-age
    return age, location, d_o_b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Then here we are to out the previous two functions by defining a new function called outputDate with multiple arguments&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def outputData(name, age, location, d_o_b):
    print(f"Hello!, {name}")
    print("You were born in the year {}, therefore, you are {} years old".format(age,d_o_b))
    print(f"And your current home address : {location}\n")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Lastly , we called the functions to displayed the inputs&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = welcomNote()

age,location,d_o_b = profile()

print("\nBelow is the brief summmary of your personal data in our database:\n")

outputData(name,age,location,d_o_b)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;## Find and replace function&lt;/strong&gt;&lt;br&gt;
_This simple Python program allows a user to replace a specific word in a sentence with another word of their choice. Here's how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User Input for Sentence:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The program prompts the user to input a sentence using input('Enter Your sentence:'). It then prints the original sentence entered.&lt;/p&gt;

&lt;p&gt;2.Word Replacement:&lt;/p&gt;

&lt;p&gt;The user is asked to specify the word they want to replace (word1) and the word they want to replace it with (word2).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Word Replacement Action:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using the replace() method, the program replaces all occurrences of word1 in the original sentence with word2 and displays the modified sentence.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
Input sentence: "The sky is blue."&lt;br&gt;
Replace word: "blue" with "green."&lt;br&gt;
Output: "The sky is green."&lt;br&gt;
_&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sentence  = input('Enter You sentence :')
print("Your sentence is: ", sentence)

word1 = input("You are replacing  :")
word2 = input("With :")

print()
print(sentence.replace(word1, word2))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;## Users Inputs registration and Validation method&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;_This Python program simulates the process of creating an account and logging in with username and password validation. Here's how it works step by step:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create Account:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The program first asks the user to enter a username and a password using input(). These values are saved as variables (username and password).&lt;br&gt;
After the user inputs the details, it prints a confirmation message: "Your account has been created successfully".&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Login Process:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The program then prompts the user to log in by asking for the username and password again.&lt;br&gt;
This process is inside a while loop, which means it will continue until the correct login credentials are provided.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Credential Validation:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In each iteration of the loop, the user is asked to input the username (namevali) and password (pwordvali).&lt;br&gt;
If the entered username and password match the ones initially created by the user, the program prints "Logged in successfully" and exits the loop using the break statement.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Handling Incorrect Credentials:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the username and password do not match, the program prints "Invalid credentials, please try again." and continues to prompt the user for their login details.&lt;br&gt;
The loop keeps running until the correct credentials are entered.&lt;br&gt;
_&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("CREATE ACCOUNT")

print()
username = input("Enter username: ")
password = input("Enter password: ")

print("Your account has been created successfully")

print("Login now!")

# Start a loop to validate credentials until they match
while True:
    namevali = input("Enter username: ")
    pwordvali = input("Enter password: ")

    if username == namevali and password == pwordvali:
        print("Logged in successfully")
        break  # Exit the loop if credentials match
    else:
        print("Invalid credentials, please try again.")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;## Calculator Method 1&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Calculator code

#return x - y:
#this function add two numbers 
def addition(x, y):
    return x + y

#this function subtract two numbers 

def substract(x, y):
    return x - y

# This function multiplies two numbers
def multiply(x, y):
    return x * y

# This function divides two numbers
def divide(x, y):
    return x / y



print("Select operation.")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")

# Take input from the user 
choice = input("Enter choice(1/2/3/4): ")

num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))

if choice == '1':
    print(num1,"+",num2,"=", addition(num1,num2))


elif choice == '2':
    print(num1,"-",num2,"=", substract(num1,num2))

elif choice == '3':
    print(num1,"*",num2,"=", multiply(num1,num2))

elif choice == '4':
    print(num1,"/",num2,"=", divide(num1,num2))
else:
    print("Invalid input/Choice")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;## Method 2:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fn = int(input("Enter first number : "))

sn = int(input("Enter second number :"))

opt = input("Your Entered Operator : ")

if opt == '+':
    print("The addition of ", fn, "and", sn, "is :",fn+sn)

if opt == '-':
    print("The subtraction of", fn, "minius", sn, "is :" ,fn-sn)


if opt == '*':
    print("The multiplication of" , fn, "times", sn, "is :",fn*sn)

if opt == '/':
    print("The division of", fn, "divided by", sn, "is :",fn/sn)

elif opt != opt:
    print('Enter the right operator')
else:
    print("")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Lastly, what i want us to talk about is Notification Displayer
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;This script is used to send desktop notifications to the user. The notification can be customized with a title, message, and additional details (like the app name). You might use this for alerting users to important events, reminders, or updates from your application.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import time
from plyer import notification

# Delay for 5 seconds
#time.sleep(5)

# Display a notification
notification.notify(
    title='Hello',
    message='This Is a Notification from Joshua',
    app_name='G-Jeotech',
    timeout=30
)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to watch my previous videos on software development, AI, ML, Data Science and,  IT related topics.&lt;br&gt;
 You can encourage me by simply hitting the subscribe button to follow my YouTube page, like, and don't forget to drop your comment in the comment section. &lt;br&gt;
&lt;a href="https://www.youtube.com/@Ifechuku.G.JeoTech" rel="noopener noreferrer"&gt;https://www.youtube.com/@Ifechuku.G.JeoTech&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>inputs</category>
      <category>validations</category>
      <category>recaps</category>
    </item>
    <item>
      <title>Malware /virus creation</title>
      <dc:creator>Onyeacholem Ifeanyi Joshua </dc:creator>
      <pubDate>Sat, 16 Oct 2021 21:52:29 +0000</pubDate>
      <link>https://dev.to/gjeotech/malware-virus-creation-1hm8</link>
      <guid>https://dev.to/gjeotech/malware-virus-creation-1hm8</guid>
      <description>&lt;p&gt;how can I get a malware that can extract files when clicked on the link ?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Having challenge in summing two similar numbers calling it out from db</title>
      <dc:creator>Onyeacholem Ifeanyi Joshua </dc:creator>
      <pubDate>Sun, 20 Sep 2020 10:23:54 +0000</pubDate>
      <link>https://dev.to/gjeotech/having-challenge-in-summing-two-similar-numbers-calling-it-out-from-db-e94</link>
      <guid>https://dev.to/gjeotech/having-challenge-in-summing-two-similar-numbers-calling-it-out-from-db-e94</guid>
      <description>&lt;p&gt;I can't sum two similar numbers calling it from db but it will insert successfully but not summing,only when I insert different number. Eg if 2 is already exist in db adding another 2 will insert but not summing to give me 4. Please I need an assistant&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
