Question 1:State the values of a, b, c, d and e after the following operations are carried out:
(a) a = 26 mod 5
b) b = 142 div 7
(c) c = (7 + 3) * 4 – 1
(d) d = 15.6 / 3 + 4.8 / 2
(e) e = β€œ4” + β€œ56”

Question 2: The function ord (’a’) evaluates to 97, the ASCII value of the character β€˜a’.
chr (97) evaluates to β€˜a’.
State what is output by this algorithm:
x = ord (β€˜b’)
y = x + 1
z = x – 1
w = chr (y) + chr (z)
print (x, y, z, w)

Question 3: What is output by the following algorithm?
notice = β€œPlease do not walk on the grass”
start = pos (notice, β€œ β€œ)
end = pos (notice, β€œt”)
x = substring (0, start, notice)
stringLength = len(notice)
y = substring (end + 2, stringLength – 1, notice)
print (β€œx = ” x)
print (β€œy = β€œ, y)
print (x + y)

PLEASE HELP ME WITH THIS QUESTIONS I DON'T KNOW HOW TO DO IT I'M LITERALLY CRYING RIGHT NOW CAN SOMEONE HELP ME THIS QUESTIONS PLEASE T-T T-T T-T

Respuesta :

Answer:

1.

a = 1

b = 20(int). 20,2857143(double)

c = 39

d = 7.6

e = 456

2.

x = 98

y = 99

z = 97

w = ca

print(x,y,z,w) -> 98 99 97 ca

3.

x = Please

y = walk on the gras

Pleasewalk on the gras

Explanation:

you can use IDE/Interpreter python to get clue number 3 and number 2

Sorry for bad English.