Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Python

Create a code that languages Python using “if statement” and the process is Asking for two numbers. If the firt one is larger than the second display the and number first, then the Is number. Otherwise, show the first no. first and then the second *Sample output Enter first numbe: 123 Enter second number: 456

29th Mar 2023, 4:39 AM
Adriane Silang
Adriane Silang - avatar
9 Answers
+ 5
Attempts?
29th Mar 2023, 5:11 AM
A͢J
A͢J - avatar
+ 4
Please share the code
29th Mar 2023, 5:27 AM
Sakshi
Sakshi - avatar
+ 4
Learn Python course from here and solve your problem. https://www.sololearn.com/Course/Python-for-Beginners/?ref=app
29th Mar 2023, 9:16 AM
A͢J
A͢J - avatar
+ 3
Adriane Silang an if is the same as: if ( I do this ( condition ) and it's OK ): print("Possible rewards ( based on this condition )") elif: print("I knew I should have done something else ( but I still am going to be rewarded )") else: print("Obviously I didn't do either and now I have error-ed in my ways")
30th Mar 2023, 2:10 AM
BroFar
BroFar - avatar
+ 2
Adriane Silang Pls note this is a learning app, and this section is for programming questions. It is not meant to ask others to write code for you.
30th Mar 2023, 1:23 AM
Emerson Prado
Emerson Prado - avatar
+ 1
Ritik Kaushal Pls avoid giving finished code as answer, because it makes the OP skip the most important part of learning. Prefer giving hints for the OP to find the solution.
30th Mar 2023, 9:04 AM
Emerson Prado
Emerson Prado - avatar
0
Sorry,my question is give a code to how create python using “if staement”
29th Mar 2023, 8:39 AM
Adriane Silang
Adriane Silang - avatar
0
Get two inputs from user and store it on different variables and use simple if statement If(a<b): Print("%d is greater"%b) else: Print("%d is greater"%a)
30th Mar 2023, 4:43 PM
Akshay Appu
Akshay Appu - avatar
0
w = input ("выберите действие; '+' '-' '/' '*': ") y = input ("введите первое число: ") x = input ("введите первое число") if w = "+": a = y + x print ("результат: " + str(a)) elif w = w = "-": a = y - x print ("результат: " + str(a)) elif w = w = "/": a = y / x print ("результат: " + str(a)) elif w = w = "*": a = y * x print ("результат: " + str(a)) else: print ("некорректно введены данные") input ()
30th Mar 2023, 6:08 PM
паша далдалвышал
паша далдалвышал - avatar