Replies

@kotov_dev
Sergei Kotov | Python Made Simple
2 months
@Python_Dv 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.
4
1
50
@KumarT00623760
Premakumar Thevathasan (Prem Iyer)
2 months
@Python_Dv Answer is: A. 45 For More Reference =>>
1
0
6
@4EverPrem
Prem Prakash
2 months
@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
0
0
3
@Manish_Kumar60
Manish Khyalia
2 months
@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.
0
0
3
@annieazul20
🌷☺ Annie πŸ’™ β‡’ ♍
2 months
@Python_Dv A. int("72β€œ) - int(β€œ27β€œ) 72-27 45
0
0
3
@umeed_aab_nhi_h
titliπŸ’›
2 months
@Python_Dv A. 45 1st it will concentrate the string then converted into integer So 72-27 =45
0
0
2
@Royce4Q2
Royce
2 months
@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
0
0
2
@Sriniva34900840
Srinivas
2 months
0
0
1
@epower234
E-Power
2 months
@Python_Dv Answer: A Concatenate p and q respectively because not are strings then subtract the results which are integers , it gives you 45.
0
0
1
@xavia_47
᙭ᗩᐯIα—©
2 months
@Python_Dv I don't know Python, buhh I think it's 45 Am I right??🫣
0
0
1
@ShiloheAi
Shiloh Egwuatu
2 months
0
0
0
@Secondmindsys
Second Mind Systems
2 months
@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.”
0
0
0
@i_m_tc
Tanmoy
2 months
0
0
0
@josefoamdz
Josefo Ξ±Ξ΄
2 months
0
0
0
@sh4kelol
Flo
2 months
@Python_Dv 45 !
0
0
0
@mi_mubarak
Al Mubarak
2 months
@Python_Dv @grok if int is not included what's the answer and give reasons
1
0
0
@SumanKhuntia13
Suman Khuntia
2 months
@Python_Dv Answer is A)45 @grok please confirm
1
0
0
@atharv_gho66071
Atharv Ghorpade
2 months
@Python_Dv 45 =72+27.
0
0
0
@Hemanshi_Tandel
Hemanshi Tandel πŸ‘€
2 months
@Python_Dv A) 45 πŸ™‚
0
0
0
@Somtokiz
Somto
2 months
0
0
0
@Mohamed40600464
Mohamed Maiga πŸ‡²πŸ‡±πŸ‡³πŸ‡ͺπŸ‡΅πŸ‡Έ
2 months
0
0
0
@codedev8282
Web Devlopment
2 months
@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.
0
0
0
@PythonHand
cloudmountain. wang
2 months
0
0
0
@__Aditya_Ch__
Aditya Chauhan
2 months
0
0
0
@cliniacordero
Clinia Cordero
2 months
@Python_Dv A. 45
0
0
0
@liufan2000
IdevebI
2 months
0
0
0
@nuwabiinembiine
Nuwabiine Mbiine Bonaventure
2 months
@Python_Dv Your are concatenating the strings, then subtracting after converting the concatenated strings to integers. So your result is 45
0
0
0
@Liax6B
Liax
2 months
0
0
0
@coolmu2
Kumar
2 months
0
0
0
@Sadashiva09
Sadashiva Sahoo
2 months
0
0
0
@MaryamSoftware
Maryam πŸ‘©πŸ»β€πŸ’»
2 months
@Python_Dv Can anyone recommend me a website where I can solve questions like this in different programming languages?
0
0
0
@Naabe_Cherish
Dane
2 months
@Python_Dv Answer is A) 45
0
0
0
@fcastroverde
fc
2 months
0
0
0
@paxhull
paxhull
2 months
@Python_Dv Error I guess 🀣
0
0
0
@jaimeespin
Jaimeespin
2 months
@Python_Dv A 45
0
0
0
@aneesrana65
Anees U Rana
2 months
@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 ```
0
0
0