Skip to content

Commit 05a28eb

Browse files
committed
add printing variable name and value tutorial
1 parent 69cd2d5 commit 05a28eb

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy
166166
- [Daemon Threads in Python](https://www.thepythoncode.com/article/daemon-threads-in-python). ([code](python-standard-library/daemon-thread))
167167
- [How to Organize Files by Extension in Python](https://www.thepythoncode.com/article/organize-files-by-extension-with-python). ([code](python-standard-library/extension-separator))
168168
- [How to Split a String In Python](https://www.thepythoncode.com/article/split-a-string-in-python). ([code](python-standard-library/split-string))
169+
- [How to Print Variable Name and Value in Python](https://www.thepythoncode.com/article/print-variable-name-and-value-in-python). ([code](python-standard-library/print-variable-name-and-value))
169170

170171
- ### [Using APIs](https://www.thepythoncode.com/topic/using-apis-in-python)
171172
- [How to Automate your VPS or Dedicated Server Management in Python](https://www.thepythoncode.com/article/automate-veesp-server-management-in-python). ([code](general/automating-server-management))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# [How to Print Variable Name and Value in Python](https://www.thepythoncode.com/article/print-variable-name-and-value-in-python)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Normal way to print variable name and value
2+
name = "Abdou"
3+
age = 24
4+
print(f"name: {name}, age: {age}")
5+
6+
# using the "=" sign
7+
print(f"{name=}, {age=}")

0 commit comments

Comments
 (0)