I'm a mechanical engineer and in this blog, I'll take you on a journey to becoming a programmer. Feel free to join the discussions and learn new things... :)
ππ‘ Python is the go-to language for AI beginners, thanks to its simplicity and powerful libraries! How familiar are you with popular libraries like TensorFlow, PyTorch, and scikit-learn? π #PythonAI#AILibraries
#Python uses a list of reserved keywords, which we cannot use as variable names.
Fortunately, there is an easy way to check this list. Just type the commands:
import keyword
print(keword.kwlist)
Have fun #coding subscribe for more #CodingTips
Decided to switch my learning course to #CS50's #IntroductiontoComputerScience as this course provides more in-depth material and I think it will lead me to a better understanding of Computer Science in general.
#Subscribe to follow my journey on learning to #code
Did you know that #Python3 lets you convert any value type to a #boolean ?
Any non-empty value is interpreted as True, while empty variable convert to False.
#coding#programming#python
#Python
Converting strings to other values is principally the same as counterwise.
For example,
int("1") = 1
float("1.1") = 1.1
bool("True") = True
#learn#coding#subscribe
Since #Python automatically recognises a value type, how do we convert it to another?
Simple solution:
str(a) takes variable 'a' as input and returns a string representation.
#Subscribe to #learn#Python with me :)
There is a way to create a variable with no value in it, or rather, a 'None-type' value in it, which can only contain 'None.'
The most straightforward way to do this:
a = None
#Learn#programming in #python with me :)
None values can be 'valuable' in debugging. For example, when we assign a print statement to a variable, the actual value of the variable becomes 'None.'
Types of multiplication within #python:
Integer * Float = Possible
Integer * string = Possible
Integer * Boolean = Possible
Float * Boolean = Possible
String * Boolean = Possible
Float * String = Impossible
Subscribe to learn more about #programming in #python3
To find out which data type we're dealing within #pythonprogramming, we can use the function: type()
For example:
input: print(type(10))
output: <class 'int'>
Joint me on my journey to becoming a #computerscience#engineer, starting with #Python.