Syntax analysis of turtle program
Syntax analysis of turtle program
1. Library reference and import
Tuttle Python drawing example code:
import turtle
turtle.setup(650.350.200.200)
turtle.penup()
turtle.fd(-250)
turtle.pendown()
turtle.pensize(25)
turtle.pencolor("purple")
turtle.seth(-40)
for i in range(4):
turtle.circle(40,80)
turtle.circle(-40,80)
turtle.circle(40, ...
Posted by smith.james0 on Tue, 04 Jan 2022 13:35:30 +0100
Write good Python comments
Python comments
Block and inline comments
# Block comments are generally used to describe the code below
if a > 10 :
# according to PEP8 Specification, block annotation with a#And a space, unless indenting is required in block comments
a = 10
else:
# A block comment should have the same indentation as the code it is commenting ...
Posted by someone2088 on Tue, 04 Jan 2022 01:21:09 +0100
An overview of the working principle of neural networks
1. Start with the simplest neural network
In the process of learning machine learning, everyone should have a basic concept of neural network: neural network is like a function fitter, it can fit any function.
def NeuralNetwork(inputs, weight): # Define Neural Network
prediction = inputs * weight # Multiply data by weight
return pre ...
Posted by ldougherty on Mon, 03 Jan 2022 17:36:31 +0100
Introduction to python Basics
catalogue
1, Getting started with python
2, python indent
3, Python comments
1) Single line note
2) Multiline comment
4, Python variables
1) Variable definition understanding
2) Variable name naming
3) Assign multiple values
4) Output variable
5) Global and local variables, global keywords
6) exercises
1, Getting started with pyth ...
Posted by metrostars on Wed, 29 Dec 2021 06:40:22 +0100
Python set
Features of the collection:
1. There are no duplicate elements, and the elements are stored in disorder (so the set has no subscripts and slices)
2. When used, {} is distinguished from Dictionary: when the element in curly braces is not a key value pair, it is a collection
3. The bottom layer of the collection is actually encapsulate ...
Posted by neerav on Sat, 25 Dec 2021 13:43:26 +0100
Teach you to write page tour automation Python script, color selection, desert recognition and background click
This tutorial is for beginners to learn python Less nonsense, let's start the python tutorial Let's use tkinter to build the basic interface of the script
Private letter Xiaobian 01 can obtain a large number of Python learning resources
import tkinter as tk#[size=3] first import tkinter, and install it into python with pip in advance ( ...
Posted by PHPrev on Fri, 24 Dec 2021 06:57:07 +0100
Course-grabbing Code of Nanjing Agricultural University--python-based selenium package + Google browser
Preface
I am an undergraduate in Nanjing Agricultural University. Because I can't grab classes, I wrote a code for grabbing classes, which is a little bug, but the effect is still good.
Small white studies, big man don't spray
Tip: The following is the main body of this article. The following cases can be used as reference.
1. Pre-prepa ...
Posted by sleightofhand on Fri, 17 Dec 2021 23:03:47 +0100
Serialization and deserialization of day14 python learning
catalogue
Introduction to serialization and deserialization
json module
pickle module
Compare the difference between json module and pickle module
Introduction to serialization and deserialization
Through file operation, we can write strings to a local file. However, if it is an object (such as list, dictionary, tuple, etc.), it cannot ...
Posted by the max on Fri, 17 Dec 2021 10:44:36 +0100
python system learning [2]
Previous: Reference blog
1. Exception handling
reference resources
1.1 an exception
try:
Code that may cause exceptions
except Exception1:
exception handling
try:
a = int(input("First integer"))
b = int(input("Second integer"))
result = a/b
print("The result is", result)
except ZeroDivisionError:
print("Divisor ...
Posted by oneofayykind on Tue, 14 Dec 2021 19:44:32 +0100
Word cloud Library Learning -- python exercises
After downloading, open the command line, use the cd command to switch to the path of the file, and execute pip install wordcloud
catalogue
Word cloud No. 1: and that government of the people, by the people, for the people, shall not perish from the earth
No. 2 word cloud: facing the sea, spring flowers bloom (text part: from tomorrow on, ...
Posted by Jackomo0815 on Tue, 07 Dec 2021 22:26:09 +0100