x = 5; x = 10?
type("Hello World")?
int("10") + 2.5?
print(float("3.14") + 2)
Nonea = 5; a = "Hello"; print(a)?
input("Enter your name: ")?
f"Hello, {name}""Hello, {name}".format()%s operatorstr.format()print("Value of x is:", 5)?
Value of x is: 5Value of x is5Value of x is: 5.0print("text", end="")echo("text")output("text")display("text")write()writelines()output()x with formatted output in Python?
print(f"x = {x}")print("x = x")print("x:", x)All of the above| Qno | Answer |
|---|---|
| 1 | b) my_variable |
| 2 | b) Object-bound |
| 3 | b) 10 |
| 4 | c) All caps variable names by convention |
| 5 | b) Tuple |
| 6 | c) Array |
| 7 | a) None |
| 8 | c) List |
| 9 | b) Float |
| 10 | a) str |
| 11 | a) int() |
| 12 | b) 12.5 |
| 13 | a) str() |
| 14 | a) 5.14 |
| 15 | a) bool() |
| 16 | b) Variables can hold any data type at runtime |
| 17 | c) Variables can change their type during execution |
| 18 | a) Adding an integer to a string |
| 19 | b) Weakly typed |
| 20 | b) Hello |
| 21 | b) input() |
| 22 | a) Displays a prompt and returns a string entered by the user |
| 23 | a) print(5 + 5) |
| 24 | a) f"Hello, {name}" |
| 25 | a) Value of x is: 5 |
| 26 | b) readlines() |
| 27 | a) print("text", end="") |
| 28 | d) Both a and b |
| 29 | a) int() |
| 30 | d) All of the above |