Computer Science
What will be the output produced?
s = 'Sipo'
s1 = s + '2'
s2 = s * 2
print(s1)
print(s2)
Python
Python Data Handling
10 Likes
Answer
Sipo2
SipoSipo
Working
s1 = s + '2'
concatenates 'Sipo' and '2' storing 'Sipo2' in s1.s2 = s * 2
repeats 'Sipo' twice storing 'SipoSipo' in s2.
Answered By
7 Likes
Related Questions
What will be the output produced?
x, y = '5', 2 z = x + y print(z)
What will be the output produced?
w, x, y, z = True , 4, -6, 2 result = -(x + z) < y or x ** z < 10 print(result)
What will be the output produced?
x, y, z = True, False, False a = x or (y and z) b = (x or y) and z print(a, b)
Program is giving a weird result of "0.50.50.50.50.50.50……….". Correct it so that it produces the correct result which is the probability value (input as 0.5) times 150.
probability = input("Type a number between 0 and 1: ") print("Out of 150 tries, the odds are that only", (probability * 150), "will succeed.")
[Hint. Consider its datatype.]