String formatting : Python tutorial 22

preview_player
Показать описание
String formatting : Python tutorial 22
Рекомендации по теме
Комментарии
Автор

There is a suggestion : You can use debug option to explain better . But your videos are exceptionally well and the best on YouTube. All the best👍👍

ajaygoel
Автор

I read about string formatting many times but
u made it most clear that
in python 3 : " {} {} ". format(var1, var2...)
in python 3.6 f" {var1} {var2} " (BEST)

akshatbhutra
Автор

Python 3.8.3

Name="Yash"
Age=18
print("Your name is", Name, "Your age is", Age)

Output:
Your name is Yash Your age is18

redtitan
Автор

name = input("Enter your name here - ")
age = int(input("Enter your age here - "))

print(f"hello {name}, your age is {age}")

and its working. thanks bro

dchiranjivi
Автор

nice string formatting.. no tension for type errors.. 👌

simondungeon
Автор

Hi Harshit, Keep up the good work. I think this one is more convenient. print ("Hello Mr.", name, "your age is", age)
commas will help reduce the time and overhead of converting variables.

mubbashar
Автор

HI Bro

Nice Videos, its very useful for newbies like me.

Keep it up !!

ancientmafia
Автор

Thanks brother you cleared my doubt...Keep it up

zenshyam
Автор

Syntax error while in adding the 2 in age ( is saying that int cannot be added to str) But your program executed well. Please explain this issue and How to solve it?

okshubhaaam
Автор

M calculation nhi kr pa rhi hu error aa rha h ki str ok add ni kr skte or age +2 str k under aa rha h...?

dikiart.mehndi
Автор

I think this code is a better :

Print ("hello", name, "your age is", age)

hdworld
Автор

What is string formatting method for 3.8.2?

shivaniyadav
Автор

But why python3 printed same line 2 time and python3.6 printed it 3 time? Why it is not printing one time?

RHTasin
Автор

name = input("enter your name ")
age = input("enter your age ")
print(f"name is {name} age is {age}")
working properly

itsahmadanwar
Автор

lakin bhai agar hum na formate string ma variables b print karna hon or curly braces b tu phir kiya method ha?

usama
Автор

Sir python 3.6 main jo aapne pehley f lagaya hai uska matlab bhi format hi hua na?

BlendBox
Автор

By using split function in input and we use print {age + 2} so it can't be run

poojaraheja
Автор

the calculation is not working it is showing syntax error like you can add only string, not any integer, I'm using python 3.7.4

narayandasahirwar
Автор

Why the output is repeating in string formatting....?

sachingiri
Автор

hi harshit, as discussed in this video the calculation did not took place at my side. m using 3.8 version