Python Interview Question #pythonprogramming #interview #python #programming

preview_player
Показать описание
Welcome to today’s Python challenge! 🐍 Can you guess the output of this simple yet tricky Python code? Watch the video and drop your answers in the comments below! Whether you’re a beginner or an expert, this is a great way to test your understanding and learn something new. Don’t forget to like, subscribe, and hit the notification bell to stay updated with more fun Python challenges.

🔍 What You’ll Learn:

• Understand Python’s evaluation of nested expressions.
• Improve your logical thinking with Python.
• See how others solve the same problem differently.

Join the challenge and see if you can get it right! Share the video with your friends and see who can guess it first!

Keywords:

Python challenge, Python quiz, Python programming, learn Python, Python code tutorial, Python for beginners, Python tips, programming challenge, coding quiz, #pythontutorial #python programming #programming
Рекомендации по теме
Комментарии
Автор

I chose false
Not because i know python
But because its too easy to be true, isiliye opposite choice select kiya

Mujtaba_Ali_
Автор

It's not a python specific thing, it's the way computers store floating point numbers in memory. They are not exact value, only till certain precision. (32 bit precision or 64 bit precision) To know more detail check IEEE 754 standard.

suryanshusharma
Автор

Don't overcomplicate it,
we use round () function when Points come into picture.

apoorvabhoine
Автор

In C language
float + float = float value

godnepal
Автор

if (0.1 + 0.2 ==
print("True")
else:
print("False") This would work

AnshumanMishra-sd
Автор

in javascript:
if((0.1 + 0.2).toFixed == (0.3).toFixed)
{
console.log("true");
}
else
{
console.log("false");
}

AdityaKumarMisra
Автор

I guessed this correctly, because once I was asking some basic questions to my friends, which they were not being able to answer. Then one of them wanted to avenge and asked Chat GPT tricky MCQ question, which was exactly this.

gatewaytothemultiverse
Автор

Kya python usues IEEE 754 standard har chiz k liye use karta hai ya only for floating values?

omkumarsingh
Автор

its using lua i found it code :

if 0.1 + 0.2 == 0.3 then
print("it's correct!")
else
print("nahh it's false")
end

local a = 0.1 + 0.2
print("it's actually ".. a)

Official_ok_noice
Автор

its not only for python but also true for java and might be for cpp

aryankaushal
Автор

iska answer do ab
x=2
y=2
if (x+y==4):
print("TRUE")
else:
print("false")

PythonCodeWithHarshoffical
Автор

if(0.1 + 0.2 ==
print("True")
else:
print("False")

(output:- True)

FullStackWebDevelopment-nh
Автор

Fault is assignment operator (=).. we should replace it by equality operator(==) at least from 11th std pyton book..

avardhan-vj
Автор

it is simple because in our computer it i store in memory as something like that because it is tolerance is not set if we want to compare we can use the math.isclose(0.1, 0.2, 0.3)

vaibhavtiwari
Автор

This happens because floating-point arithmetic in Python (and most other programming languages) can't represent certain decimal numbers exactly. When you add 0.1 and 0.2, the result is slightly more than 0.3 (i.e., so the comparison 0.1 + 0.2 == 0.3 returns False

prabityt
Автор

I've once faced it. During my early learning stage I built a float calculator which did terrible calculations with decimal numbers.

KrishnaAnand_KV_JMP
Автор

Bhai plz reply dena:
1-Ek laptop hai jo chal ni raha
2-Naya keliye paisa nahi hai
3- University ghatia sa hai
4- Environment v achha nahin hai
5- Mai kya karun carrier dub raha hai 🙏

rajeshmalla
Автор

I was right even though I have just started learning python

amartyasinghnamra
Автор

I knew the answer the answer but i wasn't able to reasoning. It was explained in CS50 pretty well.

babulo
Автор

if you try 0.2+ 0.3== 0.5 ... it gives True.. only for 0.1+0.2==0.3 is false.

NitienM