Project 1 - Build a Calculator from Scratch in Python | Python Tutorial in Hindi

preview_player
Показать описание
Calculator in Python Project - 1

➖➖➖➖➖➖➖➖➖➖➖➖➖
❤️Do Like, Share and Comment ❤️

➖➖➖➖➖➖➖➖➖➖➖➖➖
📣Want to connect with me? Check out these links:📣

➖➖➖➖➖➖➖➖➖➖➖➖➖
⭐Content⭐
✅ 00:00 Intro
✅ 02:18 Calculator in python

➖➖➖➖➖➖➖➖➖➖➖➖➖
⭐Topics covered in this video:
Calculator in python
Python project
Python for beginners

➖➖➖➖➖➖➖➖➖➖➖➖➖
Related videos:

⭐Introduction to Python Programming | Python Tutorial in Hindi 1:

📢Python Project for Data Analysis:

📢Full SQL Tutorial in One Video:

📢Full Excel Tutorial in one Video:

📢Full Power Bi + Tutorial in one Video:

🔖Complete Data Analyst Roadmap:

➖➖➖➖➖➖➖➖➖➖➖➖➖
Hope you liked this video and learned something new :)
See you in next video, until then Bye-Bye! :)

Keep learning n Keep Growing 🚀

#pythonprojects #pythontutorial #pythoninhindi
Рекомендации по теме
Комментарии
Автор

Rishabh Bhai big thanks from my side... I learnt a lot from your video.

pranavanand
Автор

thank you sir python apke wajha se samaj a raha hai.please upload more videos of python so fast complition of python series.

videocollection
Автор

i think we should add float instead of int in input numbers and in defining divide funtion a condition also
if num2 == 0 :
return "division error by zero"
and we can use f strings also in last also to make it user friendly

darkzonegaming
Автор

#Step 1:- Creating the FUNCTIONS

def sum(num_1, num_2):
return num_1 + num_2

def sub(num_1, num_2):
return num_1 - num_2

def mul(num_1, num_2):
return num_1 * num_2

def div(num_1, num_2):
return num_1 / num_2

def avg(num_1, num_2):
return (num_1 + num_2)/2

#Step 2:- User Input

print(f"Please select any one operation:\n\
1.Addition\n\
2.Subtraction\n\
3.Multiplication\n\
4.Division\n\
5.Average")

select = int(input("Select any one operation from 1, 2, 3, 4, 5: "))

num_1 = int(input("Enter first number: "))
num_2 = int(input("Enter second number: "))

#Step 3:- print the result

if select == 1:
print(f"{num_1} + {num_2} = ", sum(num_1, num_2))

elif select == 2:
print(f"{num_1} - {num_2} = ", sub(num_1, num_2))

elif select == 3:
print(f"{num_1} * {num_2} = ", mul(num_1, num_2))

elif select == 4:
print(f"{num_1} / {num_2} = ", div(num_1, num_2))

elif select == 5:
print(f"{num_1} + {num_2} / 2 =", avg(num_1, num_2))

else:
print("correct number select mado G")

srinidhistiwari
Автор

def add(a, b):
return a + b

def sub(a, b):
return a - b

def mul(a, b):
return a * b

def div(a, b):
return a / b

print (" Please Select Operation\n"
"1. Add\n"
"2. Subtraction\n"
"3. Multiplication\n"
"4. Dividedd\n"
)

num1 = int(input("Enter Number: "))
select = int(input("Enter Operation number: "))
num2 = int(input("Enter Number: "))

if select == 1 :
print(num1, "+", num2, "=", (add(num1,num2)))


elif select == 2 :
print(num1, "-", num2, "=", (sub(num1,num2)))


elif select == 3 :
print(num1, "*", num2, "=", (mul(num1,num2)))


elif select == 4 :
print(num1, "/", num2, "=", (div(num1,num2)))

else:
print("Number is Invalid")

anndane
Автор

# Assignment 4
# Write a program to create a calculator that can be perform atleast five different mathematical operations such as addition, multiplication, substraction, division and average. Ensure that he program is user friendly, prompting for input and displaying the result clearly

first_num = int(input("Enter First Number: "))
operation = input("Enter Operation for perform(+, -, *, /, %, avg) : ")
second_num = int(input("Enter second Number: "))

if (operation == "+"):
print(f"Sum is :", first_num + second_num)

elif ( operation == "-"):
print(f"Substraction is :", first_num - second_num)

elif ( operation == "*"):
print(f"Multiplication is :", first_num * second_num)

elif ( operation == "/"):
print(f"Divide is :", first_num / second_num)

elif ( operation == "%"):
print(f"Module is :", first_num % second_num)

elif ( operation == "avg"):
print(f"Average is :", (first_num + second_num)/2)

else:
print("Please Enter correct operation")


# Second Way (2) - By Function

# Steps to build calculator program
#1. functions for operation
#2. user input
#3. print result

# Step1. Create Function
# Function to add two numbers
def add(num1, num2):
return num1 + num2

def sub(num1, num2):
return num1 - num2

def mul(num1, num2):
return num1 * num2

def div(num1, num2):
return num1 / num2

def module(num1, num2):
return num1 % num2

def avg(num1, num2):
return (num1 + num2)/2

# Step 2. User input
print("Please Select a operation:\n 1. Addition\n 2. Substraction\n 3. Multiplicatio\n 4. Divide\n 5. Module\n 6. Average")

select = int(input("Select a operation from 1, 2, 3, 4, 5, 6: "))
number1 = int(input("Enter First Number: "))
number2 = int(input("Enter Second Number: "))

# Step 3. Print the Result
if select == 1:
print(number1, "+", number2, "=", add(number1, number2))
elif select == 2:
print(number1, "-", number2, "=", sub(number1, number2))
elif select == 3:
print(number1, "*", number2, "=", mul(number1, number2))
elif select == 4:
print(number1, "/", number2, "=", div(number1, number2))
elif select == 5:
print(number1, "%", number2, "=", module(number1, number2))
elif select == 6:
print("Average is", "=", avg(number1, number2))

else:
print("Please Select correct Operation :) :)")

Thank You Sir! Wonderful Session☺

RishikaSahuzz
Автор

Is se bahut easy way me maine code kiya tha.

Campus_trader
Автор

A = "Thank you"
B = "Sir"

print(f"{A} {B}!")

srinidhistiwari
Автор

Bhai mujhe visual studio me python programming kar ke external calculator banana hai usi visual studio me operations nahi karne samjhe ka?

mngs
Автор

Hello rishav sir I am not control my mind in night 1, 2, 3 till no feeling sleepy 😢

CodingfighterSaurabhyadav
Автор

print( " Sir !!! How many Videos will be Uploaded to complete this Series ? " )

JustForYou
Автор

please make a video on usage of ai in data analyst

MethreeAbhishek
Автор

Bhaiya ap Humko bta sakte ho Data analyst or Data scientist ki as a fresher salary kitni Hoti ya Plz explain kuyki apko Bhaiya ise field me experience ya

rishuthakur
Автор

sir i did it without function and only with if else statement and it is working, what is your view?

exploringnew-things
Автор

a = int(input('enter your first number: '))
b = int(input('enter your second number: '))
opp = input('enter your operator(+, -, *, /, //): ')

if opp == '+':
print(a+b)
elif opp == '-':
print(a-b)
elif opp == '*':
print(a*b)
elif opp == '/':
print(a/b)
elif opp == '//':
print(a//b)
else:
print('invalid suntax')



i this this is more easy

Tapes
Автор

Sir, mai aapko kal se linkedin pe apne post me tag karne ki kosis kar raha hu, lekin aapka naam nahi aa raha hai.

maine aapko linkedin pe already follow kiya hua hai phir bhi..😥😥😥😥🙄🙄🙄🙄😣😣

abhishekranjan
Автор

Sir I am Searching Professional Certificate Course of Data Analyst pls I need your Suggestion that will help my Future ❤❤

Strugling_Boy_AK-
Автор

College m campus aarhe h sir ... i want to complete this series as soon as possible

JustForYou
Автор

Hello bhaiya
why there is no video added in last 2 weeks
you said 2 weeks ago that you will complete the series by 2 week but there is no video uploaded till then

chitranshchaturvedi
Автор

sir i have not used function and runed succefully and better then it.

Spidey_anime
join shbcf.ru