+ 1
How can I make these codes not be associated with a single output
x=int(6+3) print (str(x)) x=int(11+22) print (str(x))
28 Antworten
+ 1
you are trying to substitute ready-made values into a variable.
Instead you should write a generic code like,
a=int(input())
b=int(input())
x=a+b
Print (str(x))
+ 4
Please, show us your code attempt
+ 4
W h e r e i s y o u r c o d e???
+ 3
What do you mean by assiciated with a single output?
+ 3
tell us what you're trying to do? solve this simple calculator problem #18?
+ 3
you are acting incorrectly. you are trying to substitute ready-made values into a variable. don't do that. the test program itself will substitute them for you. all you need to do is create two empty variables, add them, and display the result on the screen
+ 2
In the eighteenth task, do not perform two actions. you only need one operation, so half of the code can be removed
+ 2
and you should have two variables, under two numbers. each variable must contain its own number
+ 2
You solved?
+ 2
Don't use str(x). Instead just type
print(x)
Also if you want to get user input use this:
x=input()
print(x)
+ 1
works as expected, here's your code without clutter. Not sure what the issue is.
https://code.sololearn.com/cns892gXmWc0/?ref=app
+ 1
he probably means how to enter the values himself. rather than using ready-made ones - "single output".
+ 1
Not resolved
+ 1
Thanks for these answer
+ 1
Yes
+ 1
Python is an untyped language so better avoid unnecesary conversions...
x=6+3
print(x)
x=11+22
print(x)
If you need get some input as number then yes...
n=int(input())
print (n+10)
+ 1
soumya shekhar only one thing... the str(x) it's unnecessary so...
print (x)
0
In the output, these codes are in one output, and in the Python course projects, each code should have only one output
0
Okay, would you mind sharing the course project you're on? I'm still not sure what the peoblem is. Is it that it prints on seperate lines? What's your main issue?