-
νμ΄μ¬ | #2 λ°μ΄ν° νμ (int, float, complex)μΉ΄ν κ³ λ¦¬ μμ 2023. 8. 3. 22:04
type() : λ°μ΄ν°μ νμ μ 보λ₯Ό μκ³ μΆμ λ μ¬μ©νλ ν¨μ
x = 16 print(type(x)) #int
νμ΄μ¬μμλ λ³μμ κ°μ λ£μ λ μλμΌλ‘ λ°μ΄ν° νμ μ΄ μ§μ λλ€.
λ¬Έμμ΄ νμ : str
name = "python" name = 'python' name = str("python")
μ«μ νμ : int, float, complex
age = 23 #int height = 160.3 #float """ complex νμ μ 볡μμ(a+bi)λ₯Ό νννλ νμ μ΄λ€. => νμ΄μ¬μμλ jλ‘ νμλ₯Ό νννλ€. complex(μ€μλΆ, νμλΆ) """ complexNumber = 1+3j complexNumber = complex(1,3)
Random Number
νμ΄μ¬μμλ λλ€μΌλ‘ μ«μλ₯Ό μΆλ ₯ν΄μ£Όλ random() ν¨μλ₯Ό μ 곡νμ§ μλλ€.
λμ λΉνΈμΈ λͺ¨λμΈ randomμ μ 곡νλ€.
#random λͺ¨λ λΆλ¬μ€κΈ° import random #1μμ 10κΉμ§μμ λλ€μΌλ‘ μΆλ ₯ print(random.randrange(1,10))
https://www.geeksforgeeks.org/complex-numbers-in-python-set-1-introduction/
Complex Numbers in Python | Set 1 (Introduction) - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
www.geeksforgeeks.org
https://www.w3schools.com/python/module_random.asp
Python Random Module
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com