0
How can I write two codes
Some proyects need two cases but I can't or don't know how to Please help Sincerely Eros
8 Respostas
+ 2
You need to write a code that will work for any input, not just that one test case. You can declare x and y as input variables to take the input from the compiler , then manipulate what you get into what you need to output.
x = int(input())
y = int(input())
+ 1
im not completely sure what you mean by two codes, but if you need to check for 2 different cases, my initial thought would be something like the code below.
if case1 is true:
print(âcase 1 is trueâ)
elif case2 is true:
print(âcase 2 is trueâ)
lwt me know if this makes sense. also, it would be extremely helpful if you provided details of the cases.
+ 1
This case you have to option first one use 'def' fun. Or Second one is use if and elif statment.
+ 1
Thx!!
0
No I need a different answer
0
It says it is okay test case 1# or 2# but not both
0
Oki
0
x=11
y=22
z=x+y
print(z)