Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions DataStructures Basic scripts and functions related.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#List comprehensions

st = 'Create a list of the first letters of every word in this string'

[word[0] for word in st.split()]

#Map usage

names = ['Gopi','Sreekanth','Chukkapalli']

list(map(lambda x: x[0],names))

#Fizz Buzz program

for num in range(1,101):
if num %3 == 0 and num %5 == 0:
print(f"FizzBuzz and {num}")
elif num %3 == 0:
print(f"Fizz and {num}")
elif num %5 == 0:
print(f"Buzz and {num}")