you can't use this because the question is to swap the value which means the value of "a" should swap to "b" and the value of "b" should swap to "a" at the end when you print the variable "a" it should print the value of "b" it's not about showing the value the question is about to change the value from one variable to another vice-versa I hope this comment will help you, but it's been 11 months you commented to this video but i replayed now hope you understand this.
Great real life example and it worked. Of course there might be efficient ways to write this but this is what I first thought... a=input("enter value of a ") b=input("enter value of b ") c=a a=b b=c print("a is " +a) print("b is " +b)
Hello ma'am, really enjoying learning from your lectures. Actually i'm a Delhi University student pursuing an arts course. I took python as a minor. Didn't have intrest at all in the beginning because i was not able to understand anything what my teacher taught which made the subject for me "boring". But after watching your python lectures, the kind of easy explanation that you give makes the subject really interesting and learning from your videos is really worth it. I just want to thank you that because of you, I've developed keen intrest in this subject.. Now loving this subject sooooo much!!!!! Thank you ma'am.
I love it, you made great job. Your explanation so simple and amazing same time! Thank you very much, Jenny! Also I like when you draw examples and show everyhing how it works!😍
Another method for swapping is a = int(input("Enter number a: ")) b = int(input("Enter number b: ")) a = a+b b = a - b a = a - b # Use f-String to print this print(f"a = {a} b = {b}")
a=float(input("Enter value of a: ")) b=int(input("Enter value of b: ")) c=a #c==a a==a b==b a=b #c==a a==b b==b b=c print(f"a = {a}") print(f"b = {b}") What's interesting is that it changes types too, a is now int type and b is now float type and says 10.0
a = input("Enter the value of a: ") b = input("Enter the value of b: ") # Display initial values print("The initial value of a =", a) print("The initial value of b =", b) # Swap the values using a temporary variable temp = a a = b b = temp # Display swapped values print("The swapped value of a =", a) print("The swapped value of b =", b)
जीवन में कठिनाइयां हमें बर्बाद करने नहीं आती है, बल्कि यह हमारी छुपी हुई सामथ्र्य और शक्तियों को बाहर निकालने में हमारी मदद करती हैं कठिनाइयों को यह जान लेने दो की आप उससे भी ज्यादा कठिन हो।... 👍🏻👍🏻
Hello mam I have a question that We can do swaping like this but this is not swaping but like swap A=input("enter value of a=") B=input("enter value of b=") Print("a=",B "b=",A)
# Prompt user to enter the value of a a = float(input("Enter the value of a: ")) # Prompt user to enter the value of b b = float(input("Enter the value of b: ")) # Display the original values print("Before swapping:") print("a =", a) print("b =", b) # Swap the values a, b = b, a # Display the swapped values print("After swapping:") print("a =", a) print("b =", b)
a = input("Enter a value a: ") b = input("Enter a value b: ") temp = " " print("before: ") print( a + "," + b) temp = a a = b b = temp print("After: ") print( a + "," + b)
a = input("Enter the value of a: ") b = input("Enter the value of b: ") print(a,b) c = a # c = 1 print(a, b, c) a = b # a = 2 print(a,b,c) b = c # b = 1 print(a,b,c) # basically we take another container c which is empty. # 1. c mein a wali value store krdi that is (1) # 2. a mein b wali value store krdi that is (2) # 3. b mein c wali value store krdi which was basically a ki value that is (1) # summary: aik khali container c liya, us mein a ki value daal di jis se a ki value a main aue c main dono main hogyi, # phir a main b ki value daal di jis se b ki value swap hogyi, # at the end b main c ki value daal di which was basically a ki value jis se a ki value swap hogyi print(a) print(b) Enter the value of a: 1 Enter the value of b: 2 1 2 1 2 1 2 2 1 2 1 1 2 1
hi, please go through the question and understand properly, You can't use this when an interviewer asked the question because the question is to swap the value which means the value of "a" should swap to "b" and the value of "b" should swap to "a" at the end when you print the variable "a" it should print the value of "b" it's not about showing the value the question is about to change the value from one variable to another vice-versa I hope this comment will help you.
ma'am, you have said that by default input will take any values as a string,but if use interger (int) function before the input,we cannot need to concatate (+) function,right. and did you get my point??
everything is understandable easily with help of tea & milk example. and also program is very simple to understand. but i have one query on Concatenates e.g. "coma(,), plus(+),etc.. i didn't understand why we are using (+) or (,) for this swap thing? can you please torch on that point?
# Prompt user to enter the value of a a = float(input("Enter the value of a: ")) # Prompt user to enter the value of b b = float(input("Enter the value of b: ")) # Calculate the sum of a and b sum_ab = a + b # Print the sum of a and b print("The sum of a and b is:", sum_ab) Is it correct?
mam i have a doubt. In video at 21:20 duration time. u had printed jenny's "lectures" 5 times . right !. but it is printed side by side. if i want it 5 times downwards . . what is the code??
Ma'am ,I think, I can use the code like this, can't I....? Input("enter value of a=") Input("enter value of b=") Print("a=" , b ) Print("b=" , a ) Ma'am am I right or wrong???
#swaping num_1=int(input("Enter number 1 : ")) num_2=int(input("Enter number 2 : ")) num_1,num_2=num_2,num_1 print("Number 1 is ",num_1) print("Number 2 is ",num_2)
The way you are explaining with real life examples is very good🥳
Your classes are excellent🎉
One of the best lecturer!
the example of how to interchange tea and coffee is perfect and unforgettable. great way of teaching
U are really good teacher ma
The real life example you gave immediately gave me a clear understanding of the swappingg
really appreciate the way you teach mam thank you so much now im starting to gain interest in python language
a=input(print("Enter value for a: "));
b=input(print("Enter value for b: "));
print("Value of a: ",b);
print("Value of b: ",a);
you can't use this
because the question is to swap the value which means the value of "a" should swap to "b" and the value of "b" should swap to "a"
at the end when you print the variable "a" it should print the value of "b"
it's not about showing the value the question is about to change the value from one variable to another vice-versa
I hope this comment will help you, but it's been 11 months you commented to this video but i replayed now hope you understand this.
a=input("Enter value for a: ")
b=input("Enter value for b: ")
print("Value of a: ",b)
print("Value of b: ",a)
Amazing jenny ..
First program i can do it with my self with complete logic
Thanks
Great real life example and it worked. Of course there might be efficient ways to write this but this is what I first thought...
a=input("enter value of a ")
b=input("enter value of b ")
c=a
a=b
b=c
print("a is " +a)
print("b is " +b)
Another way to swap numbers
a = input("a = ")
b = input("b = ")
a,b =b,a
print("a = "+a)
print("b = "+b)
It's working
Thanks your teaching very interest, I actually like your eyes also it's beautiful.
Wow!You have exemplified all concepts really well.
Hello ma'am, really enjoying learning from your lectures. Actually i'm a Delhi University student pursuing an arts course. I took python as a minor. Didn't have intrest at all in the beginning because i was not able to understand anything what my teacher taught which made the subject for me "boring". But after watching your python lectures, the kind of easy explanation that you give makes the subject really interesting and learning from your videos is really worth it. I just want to thank you that because of you, I've developed keen intrest in this subject.. Now loving this subject sooooo much!!!!! Thank you ma'am.
Thank you for honest teaching 🙏
Aap teaching krte krte bich me smile krte ho ,to hmare face par bhi smile ata hai😂
🙂🤗🤗
7:05 thank you madam, love your teachings
a=input("Enter Value of a = ")
b=input ("Enter Value of b =")
print ("a = " + b)
print ("b = " + a)
a = input("Enter the first number...")
b = input("Enter the second number...")
# swapping the value
temp = a
a = b
b = temp
print(a)
print(b)
It's not correct
@@crazyeditzz2437 please tell me where am wrong
@@devSackey I tried print(a) and print(b) then in python it shows only a & b but not the values like a=2 and b =3 I hope u understand
@@crazyeditzz2437 i understand but i also tried it here and it showed me the value of a and b as required
@@devSackey yeah it's working good job🥰 but we should get it as a=some number and b= some number it should indicate
I love it, you made great job. Your explanation so simple and amazing same time! Thank you very much, Jenny! Also I like when you draw examples and show everyhing how it works!😍
Great teaching style, thank you for sharing your knowledge
Best channel i ever saw❤❤
Another method for swapping is
a = int(input("Enter number a: "))
b = int(input("Enter number b: "))
a = a+b
b = a - b
a = a - b
# Use f-String to print this
print(f"a = {a}
b = {b}")
I listened to your lectures man for my python final exams I passed tysm mam
*itni sundar maam 😍😍mujhe btech me milti to me Abhi Coding expert ban chhuka hota!* 😰
Glasses are cool ! Jenny madam
Nice looking ma'am and good teaching style, i love you ma'am 🙏🏻❤️🙏🏻🙏🏻
thank you ma'am great explanation🙂
The tutorial is so easy to follow and understand.
Thank you so much mam for next level of teaching
You are inspiration mam ❤️💕💕💕
a=float(input("Enter value of a: "))
b=int(input("Enter value of b: "))
c=a #c==a a==a b==b
a=b #c==a a==b b==b
b=c
print(f"a = {a}")
print(f"b = {b}")
What's interesting is that it changes types too, a is now int type and b is now float type and says 10.0
why f is required in the print statement at last what does it mean bro?
Thank you so much. I find your tutorials much easier to understand. I hope to continue learning this python programming
Ans of que at 5:10 input() is return string so we concate in print("a=" + a)
Thanks mam god bless you 🙏
Fast content delivery is important to relay on it. When exams are over then what you are uploading daily its good
Superb🎉🎉🎉🎉
we can concatinate the integer also because the input function every value it taken as string
Mam you look good without glasses.... 😊😊
yup, got it. I did have an unexpected output because I put a space in my code line but when I removed it i got the same result as you
Thank you so much mam❣️
a = input("Enter the value of a: ")
b = input("Enter the value of b: ")
# Display initial values
print("The initial value of a =", a)
print("The initial value of b =", b)
# Swap the values using a temporary variable
temp = a
a = b
b = temp
# Display swapped values
print("The swapped value of a =", a)
print("The swapped value of b =", b)
@@muhsinbinirshad but did it provide syntax error
a = input("enter value of a = ")
b = input("enter value of b = ")
a,b = b,a
print("a = " + a)
print("b = " + b)
Thank You So
Much
very nice tutorials
a,b=1,2
a,b=b,a
print("after updation a= "+str(a))
print("after updation b= "+str(b))
❤ Awesome!!!!!!!!!!!!!!!!!
Thanks mam making for this course
a= 1
b=2
a,b = b,a
print(a,b)
Ya that's also works and easy too
Okie...
Nice specs u look different but still look like my Mercury ❤️
जीवन में कठिनाइयां हमें बर्बाद करने नहीं आती है, बल्कि यह हमारी छुपी हुई सामथ्र्य और शक्तियों को बाहर निकालने में हमारी मदद करती हैं कठिनाइयों को यह जान लेने दो की आप उससे भी ज्यादा कठिन हो।... 👍🏻👍🏻
we can do this also ??
x = input("Enter a number a:" )
y = input("Enter a number b: ")
print("a =", y)
print("b = ", x)
@@tanishshriyan-ho2yt no.
Thank you so much mam🙏🙏🙂
I love mam ❤️❤️❤️
You are Good
Hello mam I have a question that
We can do swaping like this but this is not swaping but like swap
A=input("enter value of a=")
B=input("enter value of b=")
Print("a=",B
"b=",A)
use f-string for this
@@santhoshk2722 Could you please rewrite it in f string function?
Mam the value in input is string by default and the string in the print can concatenate
Understood.
Thank you for this lecture mam 🙏
# Prompt user to enter the value of a
a = float(input("Enter the value of a: "))
# Prompt user to enter the value of b
b = float(input("Enter the value of b: "))
# Display the original values
print("Before swapping:")
print("a =", a)
print("b =", b)
# Swap the values
a, b = b, a
# Display the swapped values
print("After swapping:")
print("a =", a)
print("b =", b)
a = input("Input your first number: ")
b = input("Input your second number: ")
swap = a
a = b
b = swap
print("
a = " + a + "
b = " + b)
Hello mam....can you tell me some important questions of c of chapter (arrays,pointers,strings, structures, file handling in c ) bca exams
a = input("Enter a value a: ")
b = input("Enter a value b: ")
temp = " "
print("before:
")
print( a + "," + b)
temp = a
a = b
b = temp
print("After:
")
print( a + "," + b)
Input always takes string value so, the value of 'a' and 'b' is string here.
num1 = input("Enter number 1 : ")
num2 = input("Enter number 2 : ")
temp = num1
num1 = num2
num2 = temp
print("Value of number 1 is",num1,"Value of number 2 is",num2)
a = input("Enter the value of a: ")
b = input("Enter the value of b: ")
print(a,b)
c = a # c = 1
print(a, b, c)
a = b # a = 2
print(a,b,c)
b = c # b = 1
print(a,b,c)
# basically we take another container c which is empty.
# 1. c mein a wali value store krdi that is (1)
# 2. a mein b wali value store krdi that is (2)
# 3. b mein c wali value store krdi which was basically a ki value that is (1)
# summary: aik khali container c liya, us mein a ki value daal di jis se a ki value a main aue c main dono main hogyi,
# phir a main b ki value daal di jis se b ki value swap hogyi,
# at the end b main c ki value daal di which was basically a ki value jis se a ki value swap hogyi
print(a)
print(b)
Enter the value of a: 1
Enter the value of b: 2
1 2
1 2 1
2 2 1
2 1 1
2
1
val1 = input("enter the value of A = ")
val2 = input("enter the value of B = ")
print("A = " +val2)
print("B = " +val1)
hi, please go through the question and understand properly, You can't use this when an interviewer asked the question
because the question is to swap the value which means the value of "a" should swap to "b" and the value of "b" should swap to "a"
at the end when you print the variable "a" it should print the value of "b"
it's not about showing the value the question is about to change the value from one variable to another vice-versa
I hope this comment will help you.
a = 11
b = 7
temp = a
a = b
b = temp
print(a)#7
print(b)#11
output
7
11
Process finished with exit code 0
#swap 2 numbers
a = 20
b = 30
c=b
b=a
a=c
print(a,b)
apologize due to work I missed 1 2 lecture thanks a million.
queen of code ❤️❤️
another way:
a=int(input("Enter value of a="))
b=int(input("Enter value of b="))
num_1=b
num_2=a
print(f"a={num_1}
b={num_2}.")
thank you mam
a=int(input("Enter First Number"))
b=int(input("Enter Second Number"))
print("two numbers are:
")
print(a,b)
c=a
d=b
b=c
a=d
print("swaped numbers are:
")
print(a,b)
Use only one extra variable to swap
@@JennyslecturesCSIT
done..Im sorry for late reply
a = input("a: ")
b = input("b: ")
c=a
a=b
b=c
print("a: " + a)
print("b: " + b)
num1 = input ("value of a")
num2 = input ("value of b")
num1 = num2
num2 = num1
Print ("num1
num2")
Sry print num4 and 5
ma'am, you have said that by default input will take any values as a string,but if use interger (int) function before the input,we cannot need to concatate (+) function,right. and did you get my point??
everything is understandable easily with help of tea & milk example. and also program is very simple to understand. but i have one query on Concatenates e.g. "coma(,), plus(+),etc.. i didn't understand why we are using (+) or (,) for this swap thing? can you please torch on that point?
Just watched 8th lecture again and i got my answer that it is print(string & integer) e.g. print("a=" +/, a) ✔️ 🤩
# Prompt user to enter the value of a
a = float(input("Enter the value of a: "))
# Prompt user to enter the value of b
b = float(input("Enter the value of b: "))
# Calculate the sum of a and b
sum_ab = a + b
# Print the sum of a and b
print("The sum of a and b is:", sum_ab)
Is it correct?
mam i have a doubt. In video at 21:20 duration time. u had printed jenny's
"lectures" 5 times . right !. but it is printed side by side. if i want it 5 times downwards . . what is the code??
I like ur real life examples mam 😂
b=input("enter value of a ")
a=input("enter value of b ")
print("b= "+b)
print("a= "+ a)
please reply tell me if did anything wrong here
Todays exercise -
a=input("X= ")
b=input("Y= ")
c=a
a=b
b=c
print("X= "+a)
print("Y= "+b)
a=input("enter value of a=")
b=input("enter value of b=")
a=b
b=a
print("a=2")
print("b=1")
Is it right or wrong?
how to store two numbers in two different variable using one input statement
for eg -
if I say -
Enter two numbers
Thank you so much mam for this course 😊
a=input ()
b=input ()
Print("a = " +b)
Print("b = " + a)
Out_put:
a = 2
b = 1
In_put:
1
2
Is it right?
b=input("enter the value of a=")
a=input("enter the value of b=")
print("a=" +a)
print("b=" +b)
is it correct mam?
a=input("Enter value of a = ")
b=input("Enter value of b = ")
print("a = "+b)
print("b = "+a)
mam we can use this way...Is it right madam?
a=input("enter the value of a:")
b=input("enter the value of b:")
print("a="+b)
print("b="+a)
We can use this right
may be this is easier try this
a=10
b=12
a,b=b,a
print(a)
print(b)
Why should u use +a we can use print("a=" a)
Thank you for this course 😊 mem
Ma'am ,I think, I can use the code like this, can't I....?
Input("enter value of a=")
Input("enter value of b=")
Print("a=" , b )
Print("b=" , a )
Ma'am am I right or wrong???
a=input("your value a:-")
b=input("Your value b:-")
print("a=" + b)
print("b=" + a)
it is simple why use temp?
Can you make a video with topics like escape,traverse,
Could you please tell me madam, in case we entered "+" place to "-". It's solve?
#swaping
num_1=int(input("Enter number 1 : "))
num_2=int(input("Enter number 2 : "))
num_1,num_2=num_2,num_1
print("Number 1 is ",num_1)
print("Number 2 is ",num_2)
can we use replace function
to swap
Why we need to concatenate in final print step i don understand this step can you explain madam.
Mam your explanation is well but,we want some more examples
Mam ek simple aap our website ki kuch coding karke kisi koi opreting model me install ka koi video banayena
can we write
print(a)
print(b)
at the last 2 lines instead for that like...same ouput I
got?
am a little bit confused in the swapping logic.
Chashma mei achhi lag rahi mam. Superb