-
Python How to print a Pyramid
A simple Python example to print half and full pyramid, just for fun.
2019-08-11【[Java]】
阅读更多 -
Python How to convert float to String
In Python, we can use str() to convert float to String.
2019-08-11【[Java]】
阅读更多 -
Python How to convert String to int
In Python, we can use int() to convert a String to int.
2019-08-11【[Java]】
阅读更多 -
Python How to check the variables type?
In Python, we can use type() to check the variable’s type.
2019-08-11【[Java]】
阅读更多 -
Python How to convert int to String
In Python, we can use str() to convert a int to String.
2019-08-11【[Java]】
阅读更多 -
Python How to convert String to float
In Python, we can use float() to convert String to float.
2019-08-11【[Java]】
阅读更多 -
Python How to use a global variable in a function
In Python, we can use a global keyword to referring a global variable.
2019-08-11【[Java]】
阅读更多 -
Python How to check if a file exists
In Python, we can use os.path.isfile() or pathlib.Path.is_file() (Python 3.4) to check if a file exists.
2019-08-11【[Java]】
阅读更多 -
Python Check if a String contains another String?
In Python, we can use in operator or str.find() to check if a String contains another String.
2019-08-11【[Java]】
阅读更多 -
Python Count the number of items in a list
In Python, we can use len() to count the number of items in a List
2019-08-11【[Java]】
阅读更多 -
Python How to list all files in a directory?
In Python, we can use os.walker or glob to create a find() like function to search or list files or folders in a specified directory and also it’s subdirectories.
2019-08-11【[Java]】
阅读更多