Post

Sergei Kotov
Sergei Kotov@kotov_dev·
Answer: A) 45 The trick: p and q are strings, not numbers! › p+q = "7"+"2" = "72" (concatenates) › q+p = "2"+"7" = "27" (concatenates) › int("72")-int("27") = 72-27 = 45 For beginners: + concatenates strings! If they were numbers, p+q=q+p and result would be 0.
English
0
0
0
961
Prem Prakash
Prem Prakash@4EverPrem·
@Python_Dv 45 Both p and q are defined as strings. The plus sign with strings concatenates them. Thus print(p+q) = 72 print(q+p) = 27 Later these output are type cast to int to perform subtraction which yields 45
English
0
0
0
425
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
@Python_Dv Answer:-(A)45 Here p and q are two strings. Step1:- p+q means concatenate two strings So, p+q="72" then convert it into integer. So first part become 72(int). Step2:- q+p="27" again convert it in integer 27. Step3:- 72-27= 45 So correct answer is 45.
English
0
0
0
680
Royce
Royce@Royce4Q2·
@Python_Dv p = "7" q ="2" print(int(p+q) - int(q+p)) #(7 + 2) = 72 - (2 + 7) = 27 # 72 - 27 = 45 #A) 45 72 -27
English
0
0
0
132
miss Impeccable🦋
miss Impeccable🦋@umeed_aab_nhi_h·
@Python_Dv A. 45 1st it will concentrate the string then converted into integer So 72-27 =45
English
0
0
0
145
E-Power
E-Power@epower234·
@Python_Dv Answer: A Concatenate p and q respectively because not are strings then subtract the results which are integers , it gives you 45.
English
0
0
0
274
Sunil Yadav
Sunil Yadav@SunilY96965·
@Python_Dv It is a not number,it is a string P="7" q="2" Print(int(p+q)-int(q+p)) P+q=72 q+p=27 72-27=45 Ans:45
English
0
0
0
78
Second Mind - Systems
Second Mind - Systems@Secondmindsys·
@Python_Dv String concatenation disguised as arithmetic. ‘72’ − ‘27’ = 45 — the kind of trick that reminds you why context matters in both code and cognition.”
English
0
0
0
270
Nuwabiine Mbiine Bonaventure
Nuwabiine Mbiine Bonaventure@nuwabiinembiine·
@Python_Dv Your are concatenating the strings, then subtracting after converting the concatenated strings to integers. So your result is 45
English
0
0
0
3
Anees U Rana
Anees U Rana@aneesrana65·
@Python_Dv Step 1: String concatenation · p + q = "7" + "2" = "72" · q + p = "2" + "7" = "27" Step 2: Convert to integers · int(p+q) = int("72") = 72 · int(q+p) = int("27") = 27 Step 3: Perform subtraction · 72 - 27 = 45 Final Answer: ``` 45 ```
English
0
0
0
40
Dane
Dane@Naabe_Cherish·
@Python_Dv Answer is A) 45
Accra, Ghana 🇬🇭 English
0
0
0
37
Web Devlopment
Web Devlopment@codedev8282·
@Python_Dv p = "7" and q = "2" are strings. p + q concatenates to "72", and q + p concatenates to "27". int(p + q) - int(q + p) converts these to integers and subtracts: int("72") - int("27") = 72 - 27 = 45.
English
0
0
0
57
Paylaş