Forgot what certain commands did in python 3 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Forgot what certain commands did in python 3

Hey, so I saw a ton of commands being used in the lessons and I completely forgot what they did. Could someone please tell me what "str", "int", "+=", and "!e" do?

18th Oct 2018, 2:44 PM
Vadertrooper
Vadertrooper - avatar
1 Answer
+ 2
str is a built-in function in python which is use to convert int or something into string.e.g x=3 print(str(x)) #now x is str not int. int is built in function in python which is use to convert string digit into int.e.g x='3' print(int(x)) #now x is int not a string. += it is just a shortcut for adding two something. e.g x=1 for m in range(1,3): x+=m #it is equal to x=x+m so it is just a shortcut. you can also check here. https://data-flair.training/blogs/python-operator/
18th Oct 2018, 3:52 PM
Maninder $ingh
Maninder $ingh - avatar