You are viewing a single comment's thread from:

RE: LeoThread 2024-12-09 01:35

in LeoFinance2 months ago

Doing some very basic practice problems with Python:

num1 = float(input(("Type a stupid number number: ")))
num2 = float(input(("Type another number: ")))
sum_result = num1 + num2
print (f"yes, {num1} is a stupid number, but did you know that you can add it to {num2} to get {sum_result}?")

This practice problem performs the following steps in Python:

Take User Input:

The program asks the user to enter two numbers.
float(input(...)) converts the user input (which is initially a string) into a floating-point number, allowing both integers and decimals.
Perform Addition:

The two numbers, num1 and num2, are added together using the + operator.
The result of the addition is stored in the variable sum_result.
Display a Message:

The program uses an f-string to format a message.
It includes the user-provided numbers (num1, num2) and the computed sum (sum_result) in the output.

#python #programming #learning

Sort:  

the code is solid but I like your input ( type a stupid number) 🤣 if you create a calculator I'll use it hahaha

My calculators will have a special twist 😄

a very special one

Oooops this is obviously for the programmers , now you make me feel lost..lol