python | Unsorted

Telegram-канал python - Python

135201

You will be muted until you read the rules. Read them! @Rules_for_Python A group about the Python programming language. Offtopic things go here: @pythonofftopic Resources to learn python: @pythonres Group for Hy: @hylang Selenium: @SeleniumPython

Subscribe to a channel

Python

print("Your grocery list")
Grocery={
"Rice":60,
"Wheat Flour":40,
"Sugar":45
}
total_amount=0
cart=[]
print(Grocery)
print("*************************")
while True:
item=input("Enter the item in Grocery:(q to quit)")
if item.lower()=='q':
break
elif item not in Grocery:
print("Please enter the item in Grocery list")
else:
cart.append(item)
try:
Quantity=int(input("Enter the Quantity for the item:(q to quit)"))
if Quantity == 'q':
break
elif Quantity <0:
print("Please enter a Quantity greater than '0'")
except ValueError:
print("Please enter a valid quantity")
else:
item_cost=Grocery[item]*Quantity
total_amount+=item_cost

print(total_amount)

My question is for the above code if i give input : rice its giving me error: Please enter a valid item in list.Kindly someone guide
i want to try without converting the actual grocery list

Читать полностью…

Python

I belive you are trying to run python statement import in bash which is not python

Читать полностью…

Python

Adding the word Python to your off-topic question doesn't magically turn it to a Python related question, so please delete your message here and move to the @PythonOfftopic group and ask there.

Читать полностью…

Python

One of the thing it does
https://docs.python.org/3/library/marshal.html

noransaber685/demystifying-python-bytecode-a-guide-to-understanding-and-analyzing-code-execution-6a163cb83bd1" rel="nofollow">https://medium.com/@noransaber685/demystifying-python-bytecode-a-guide-to-understanding-and-analyzing-code-execution-6a163cb83bd1

Please read carefully

Читать полностью…

Python

So tell me how bytecode is generated in python

Читать полностью…

Python

then you say I must google, fuck it I won't waste my time again

Читать полностью…

Python

yes but you don't believe me

Читать полностью…

Python

In python interpreter execute the byte code

Читать полностью…

Python

Brother are you serious?

Читать полностью…

Python

Take python as an interpred language even if internally has an intermediate step

Читать полностью…

Python

The interpreter does

Читать полностью…

Python

It requires compiler

Читать полностью…

Python

Why you need bytecode?

Читать полностью…

Python

I bet it explained what he meant. But anyways.

Читать полностью…

Python

No brother somewhere it is showing interpreter or somewhere it is showing both(complier and interpreter)

Читать полностью…

Python

This is not a Python specific question, please delete your offtopic message, move to @PythonOfftopic and ask there.

Читать полностью…

Python

This is not a Python specific question, please delete your offtopic message, move to @PythonOfftopic and ask there.

Читать полностью…

Python

Hello.

Can anyone help with suggestions or solution of why getting "bash: import: command not found" error in VS code editor python 3.11 virtual environment in debian 12?

Читать полностью…

Python

the interpreter does it, you don't "compile" it as you do in a compiled language to run your code, you know.. don't you?

Читать полностью…

Python

I did and I tell u what I get

Читать полностью…

Python

first you dont google

Читать полностью…

Python

have you even run python code before?

Читать полностью…

Python

bytecode is platform dependant

Читать полностью…

Python

To make platform independent

Читать полностью…

Python

but again, why you need bytecode?

Читать полностью…

Python

No way how python convert the source code into byte code without compiler

Читать полностью…

Python

Thats a process python does automatically

Читать полностью…

Python

If it is interpreted language then how it convert the source code into byte code

Читать полностью…

Python

Where is shown as compiled and interpreted?

Читать полностью…

Python

That's something you can easly answer by googling. Please use this group for more specific questions

Читать полностью…
Subscribe to a channel