Skip to content

Commit dfcb932

Browse files
committed
2024/03/15 - Adding keyword demo python code along with renaming of files
1 parent b025f61 commit dfcb932

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed
File renamed without changes.

concepts/DataTypeDemo.py renamed to concepts/PythonDemo02_DataTypes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ def _dictionary_data_type_demo() -> None:
134134
def _set_data_type_demo() -> None:
135135
set1 = {1, 1, "Rohit"}
136136
print("set1 ", set1)
137+
set1.add("Pooja")
138+
print("set1 after adding element 'Pooja' ", set1)
139+
140+
set1.add("Pooja")
141+
print("set1 after adding same element 'Pooja' ", set1)
137142

138143
print("**" * 25)
139144

concepts/PythonDemo03_Keywords.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file gives demo about different keywords
2+
3+
# how to list python keywords
4+
# option 1 - using help functions
5+
6+
help("keywords")
7+
8+
# option 2 - using keyword library
9+
import keyword
10+
11+
# displaying the complete list using "kwlist()."
12+
print("The set of keywords in this version is: ")
13+
print(keyword.kwlist)
14+
15+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy