+ 9
What is the use of " ; " in python
8 Réponses
+ 5
x=int(input());
y=int(input());
print(x+y);
that was Python code why work that code try it
+ 5
10ks
+ 2
Melu Pitor
x = 5; y = 10; sum = x+y; print(sum)
is the same with:
x = 5
y = 10
sum = x+y
print(sum)
+ 2
Melu Pitor, u can use ";" to write multiple statements in a single line
- In python its reduntant to put semicolon at the end of multiple statements in multiple lines (unlike c++)
0
It is used to separate code, they generally are not required, but they can be used to make one liners or shrink code
https://code.sololearn.com/cljy1zAqvkis/?ref=app
https://code.sololearn.com/cGk62H723O0u/?ref=app
0
we can use ";" to write multiple codes in single line like
a=2
b=3
we can assign the values for both a and b in the single line as given below
a=2;b=3
0
"" it means that your code is string