#pythonprogramming #interview Question comment your answer

preview_player
Показать описание
Ever been in a Python interview and faced a tricky question like this? 🤔 Let’s dive into a common mistake you must avoid!

In this code, we use an if-else statement with the condition 1 == 01:. What do you think will happen? Will the output be:

1️⃣ True
2️⃣ False
3️⃣ Syntax Error

Pause the video, think about it, and drop your answer in the comments! 👇

Spoiler Alert: It’s a Syntax Error! Want to know why? Python doesn’t allow leading zeros in decimal numbers. Learn how to fix this and avoid common pitfalls like a pro! 🚀

Watch the full explanation and stay ahead in your Python game! 💡

Python Interview Question
Python Syntax Error
Common Python Mistakes
Python Leading Zeros
Python Coding Interview
Python if else Statement
Python for Beginners
Python Coding Tips
Python Error Handling
Python Developer Interview
Python Programming
Python for Job Interviews
Python Coding Challenges
Python True False
Python Conditional Statements
Рекомендации по теме
Комментарии
Автор

Kyuki leading zero number format specify karne ke liye hota hai. 0b1 (binary), 0x1 (hex), 0o1 (oct), 0<anything>1 (err). Reply to my comment for python help :)

aryanjain
Автор

This is a very important concept that we all have to know if we are a python developer.
I have not known this, at first I thought that it should be true as we can write 1 as 01 in maths but when I run this program in my laptop I was shocked that it gave me an error .

ehsaaseimaan
Автор

I got to know, when i m doing my 11th class practicals of python.. Then i asked my teacher, then he told me about this.. ❤❤❤

tyagi
Автор

Is video me hi question ka answer chhupa tha

Aapne bola Python me agar 0o(integer) format mein koi number likhte hain,
Toh,
Number Octal me convert ho jayega,
Now
Python ne apne samjhne ke liye ek convention bana di hai,
Ki koi bhi integer number ko convert karna pade doosre base ke number me,
Toh,
Vo 0 ke baad us base ke number ka symbol expect karega,

Eg,
Apne case me 01 hai,
Ab jab python ise read karega,
Toh use 0 milega,
0 dekhker use lagega ki ye number ko convert karne ka time hai using the formula "0o(integer)"
Isliye vo next o ko expect karega,

But hum log ne 0 ke baad 1 likha hai,
Toh,
Yahan pe python confuse ho jayega,
Aur error de dega,

Ambiguity na hoye,
Isliye ye convention hi bana diya,
Ki agar number 0 se start karna hai
Toh aap bas convert kar sakte hain

saumytiwari
Автор

Bhai bhaut ache se samaj aata hai ek full course python beginners banao na

yourcruzai
Автор

Because python mai decimal mai jaata hai woh zero nhi hoga means dot lagana padhega usme

gamingvishal
Автор

In Python, numbers with leading zeros are treated as integers. Therefore, 01 is just 1.

anurag
Автор

Phthon starting ka kuch batao na today i started phthon kuch samajh nhi aaya

brightfuture
Автор

Thanks bro get a new information today ❤

devpthakkar
Автор

Syntax error : leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

R.O-stex
Автор

if 1==int('01'):
print('True')
else:
print('False')

example

(10) in decimal 012 in octal
but 012 in decimal 12
is liye python leading 0 ko error print karta hai
like a=1, a==1
that's why 1 cheez k bohot sare meanings se bachne k liye

youvin
Автор

Bro, i am new to python but i knew the answer because i made some mistakes before while practicing.

vshal
Автор

Bhai mast tha ye ase hi banao information wala bahut ho hua isse

gymjabhai
Автор

Nice concept bhaiya, aur banate jao aaise videos 👍

chaitanyabelekar
Автор

ese video shorts mein aye to Dil khush ho jata hain...😊

teamup
Автор

Wah bhiya kuch naya sekhna ko mila ajj ❤❤
Thank you 🙏😊

anita_rai_
Автор

Kuch samajh me nahi aaya lekin 😂 sun ke accha laga 😂

Scaryruniverse
Автор

How python was programmed.
What programming was used to program this program

Ch.AnuragSharma
Автор

Computer to dur ki baat main to maths ka student bhi nhi hu. Mujhe kyu ye video recommend hui😂

kvtechvarshney
Автор

Mei ne ye khud karke pahale dhekha thaa yes error ati hai 👍

ideologybylakshya
welcome to shbcf.ru