Please enable JavaScript.
Coggle requires JavaScript to display documents.
Python (Programming Language)
[공식사이트] [wiki)]
Python is an interpreted,…
Python (Programming Language)
[공식사이트] [wiki)]
- Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readability with its notable use of significant whitespace. Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.
Module Reference
- Consider a module to be the same as a code library.
A file containing a set of functions you want to include in your application.
Requests Module
[w3스쿨]
- Make a request to a web page, and print the response text
Methods
get()
[w3스쿨]
- Syntax : requests.get(url, params={key: value}, args)
- Sends a GET request to the specified url
post()
[w3스쿨]
- Sends a POST request to the specified url
Python Reference
- This section contains a Python reference documentation.
Ord()
[w3스쿨]
- Convert an integer representing the Unicode of the specified character
Enumerate()
[w3스쿨]
- Takes a collection and returns it as an enumerate object
input()
[w3스쿨]
- Syntax : input(prompt)
- Allowing user input
Normal Example
- x = input('Enter your name:')
print('Hello, ' + x)
map()
[w3스쿨]
- Syntax : map(function, iterables)
- Returns the specified iterator with the specified function applied to each item
Normal Example
- def myfunc(n):
return len(n)
x = map(myfunc, ('apple', 'banana', 'cherry'))
result : ['5', '6', '6']
- x1, y1, r1, x2, y2, r2 = map(int, input().split())
int()
[w3스쿨]
- Syntax : int(value, base)
- Returns an integer number
max()
[w3스쿨]
- Syntax : max(n1, n2, n3, ...)
- Returns the largest item in an iterable
String Methods
[w3스쿨]
- Python has a set of built-in methods that you can use on strings.
format()
[w3스쿨]
- Formats specified values in a string
- Syntax : string.format(value1, value2...)
Find()
- Searches the string for a specified value and returns the position of where it was found
[w3스쿨]
split()
[w3스쿨]
- Syntax : string.split(separator, maxsplit)
- Splits the string at the specified separator, and returns a list
Normal Example
- txt = "welcome to the jungle"
x = txt.split()
print(x)
result : ['welcome', 'to', 'the', 'jungle']
remove()
[w3스쿨]
- Syntax : list.remove(elmnt)
- Removes the first item with the specified value