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

That's not using add_void and get_input_void.

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

Python

I have finally hit None

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

Python

I am rather quite enjoying it so far

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

Python

Mind sharing what you have?

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

Python

Yeah, are you stuck? Or don't have time to work on it?

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

Python

Why do I get the feeling that I am sent to do something undoable🙂

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

Python

When I use the functions twice, do you want me to add the result of the previous to the second or you want two independent results from the same function?

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

Python

More like

def user_input_void():
global x
x = int(input("Enter x: "))

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

Python

And this is me using a return-value function

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

Python

Let me tag them for you.
I have already sent it in this group

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

Python

I use the variable I created.
And yes you will ask, how would you do that without the return function?
I use global variables

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

Python

Yes, I wrote exactly this. I forgot to send it to you.

What are you trying to achieve with these questions?

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

Python

Something like

#addition
def add():
total= num1+num2
print(total)

#using the function
num1= int(input("Enter num1?: "))
num2= int(input("Enter num2?: "))
add()

num1= int(input("Enter num1?: "))
num2= int(input("Enter num2?: "))
add()


?

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

Python

I'd do the same for the subtraction.

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

Python

I thought your question was more complicated than it was.
I defined separate functions. One calculates savings and the other calculates revenue just to use the addition and subtraction.
I was struggling to find something they have in common where I'd need to use both addition and subtraction.
After some headache, I reread your question and it was not even that difficult 😂

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

Python

#monthly income
def income():
remaining_balance = int(input("Enter the remain: "))
expenses = int(input("Enter the expenses: "))
global total
total = remaining_balance + expenses
income()
print(f"your total income is: {total}")
#extended...
total = income()
print(total)

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

Python

Okay, then I'll be patient 😊

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

Python

The purpose is not to torture you but to make a point. We can go from what you have so far.

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

Python

I wouldn't say I am stuck but I am not making that much progress 😂

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

Python

It's not undoable, it's just gets messy.

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

Python

Yes, user input 1 + user input 2

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

Python

Let's make a deal. You do the versions with void function, where the user_input_void function is used twice to get the input from the user, and I do the one with the return statements. But also add the two inputs from the user with add_void.

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

Python

#void-func extended:
def add_void(x,y):
global result
result = x+y
print(result)

add_void(3,3)
add_void(result, 4)
void_input = int(input("Enter your number?: "))
add_void(result,void_input)
Output: 10+input

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

Python

This is me using a global variable

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

Python

So, let's compare those two versions then.

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

Python

What do you do when you want to use the result from the first addition in the second?

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

Python

I am working on a personal project I have concluded the project but I want to add wallet features that each user can transfer into a dedicated virtual account number and it will be captured by the portal in Django

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

Python

So, when you want to reuse add what would you do?

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

Python

Here's an example of addition:
#addition
def add():
total= num1+num2
print(total)
#using the function
num1= int(input("Enter num1?: "))
num2= int(input("Enter num2?: "))
add()

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

Python

oop stands for object oriented programming, its serves the purpose of encapsulation ,abstraction , inheritance and isomorphism .
classes are used in python to do this , a class instance can be initialized with some data then the methods of that class can use that data internally to do smthing (encapsulation) . i see making a class in itself as a way of abstraction . and these classes can be sub classes or parent classes of other classes so inheritance . i dont know much about polymorphism

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