![]() ![]() Then, we’ll cover how to use some of the functions in the `math` library in Python. First, we’ll cover how to use base Python (no imported libraries) to do basic math on floats and integers. This post is for anyone looking to get into a Python role working with data or machine learning. ![]() Print("Unfortunatly that is incorrect.If you’re doing anything data science or machine learning related in Python, you should know some math. Print("Well done, you have got the question correct. While userans = "" or not re.match(r'^*$', userans): N1, n2, userans = random.randrange(12), random.randrange(12), "" Print("The question you are currently on is: ", qa) Print("\nClass entered was " class_choice) While name = "" or len(name) > 25 or not re.match(r'^*$', name):Ĭlass_choice = input("Please enter you class (1, 2, 3): ") Not only does it mean that your code is easier to read and understand, it also means it takes less time to compile (which is important with longer scripts) Having concise code is equally important. Logical names for variables just means that it is easier to understand and call them later on. This makes it easier to debug and also makes it easier to edit and comprehend later on. So asking the user their name and checking it is one part, and thus one subroutine. Modularising the program just means to put it into many subroutines.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |