What's the meaning of this code?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What's the meaning of this code??

Print("example %.2f" %36)

10th Oct 2019, 12:51 PM
Masoud
Masoud - avatar
5 Answers
+ 3
print(string % value) in Python corresponds printf(string, value) in C. string % value is used to create C-style string formatting in Python. In string: % means that there is being inserted a value representation. %f means that the inserted value must be represented as a floating point number. %.2f means that the inserted floating point representation is limited to have only 2 decimal places.
10th Oct 2019, 1:06 PM
Seb TheS
Seb TheS - avatar
+ 1
Thanks🙏
10th Oct 2019, 7:11 PM
Masoud
Masoud - avatar
0
Hey pliz complite . Complete the code to create a string containing a double quote.
11th Oct 2019, 2:52 AM
AHL ESSAID OMAR
AHL ESSAID OMAR - avatar
0
(A) if _ main _ == “ _ name _ “ : ... # suitable code (B) if _ main _ == “ _ mdl _ “ : ... # suitable code (C) if _ name _ == “ _ main _ “ : ... # suitable code (D) if _ name _ == “ _ mdl _ “ : ... # suitable code
11th Oct 2019, 1:52 PM
Mohit Gautam
Mohit Gautam - avatar
0
I c
11th Oct 2019, 9:49 PM
Emma