πŸ‘©β€πŸ’» Learn PROGRAMMING πŸ‘¨β€πŸ’»
6.53K subscribers
108 photos
10 videos
30 files
106 links
πŸ–₯Everything About Computer Science and CodingπŸ“²
πŸ“°News, Infographics, Quotes, Memes & Facts
πŸ’ΈYou can join us just for 0β‚Ή/0Β£/0€/0$
Admin: @Augustus_Caesar_Emperor_of_Rome
Download Telegram
Did You Know - Python Tips : 001

# Very simple string reverse trick in Python
x = 'Python'
print(x[::-1])

Β» nohtyP

#python #tips #HowTo
Did You Know - Python Tips : 002

# In-Place Swapping Of Two Variables, works with any datatype

x, y = 'hello', 'world'
print(x, y)
x, y = y, x
print(x, y)

#python #tips #HowTo
Did You Know - Python Tips : 003

# Using all the elements in a list, create a single string

mylist = ["Hello!", "Welcome", " to", "iGnani"]
print(" ".join(mylist))

#python #tips #HowTo
Did You Know - Python Tips : 004

#Chaining assignment : assigning the same value to multiple variables, all variables will reference the same object
# Useful when initialising a set of variables with a default value.

a = b = c = x = y = z = 0
print(a, b, c, x, y, z)

#python #tips #HowTo