Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
1 #-*- coding : utf-8 -*-
2 import math 3 4 def move(x, y, step, angle=0): 5 nx = x + step * math.cos(angle) 6 ny = y - step * math.sin(angle) 7 return nx, ny
Create a new Python file, save it as move, python interactive interface, import the move function, execute the function, and report an error
Before executing the function, enter
import math
Execute function without error
Similar Posts:
- Python solves the problem of modulenotfounderror: no module named ‘queue’
- NameError: name ‘pip’ is not defined
- RuntimeError: Python is not installed as a framework [How to Solve]
- After installing BS4 in Python, pychar still reports module not found error: no module named ‘BS4’
- How to Solve Beautifulsoup Error: “No module named ‘bs4’.” [from bs4 import BeautifulSoup]
- How to Solve Centos Yum Error: No module named yum
- [Solved] Error in Python selenium + phantom JS alert() pop-up window
- ImportError: No module named pytz
- Python solves the problem of NameError: name ‘reload’ is not defined
- Using pyenv causes the problem that python3 cannot import SQLite3