Python Universe
1.99K subscribers
103 photos
1 video
1 file
55 links
Everything you need to know about Python programming.

Admin: @haraisen
Feedback: @pythontg_feedbackbot
Download Telegram
Channel created
Take your first steps with Python 🐍

Hi, Python Universe team here! We've created this channel to share our knowledge and experiences in Python programming with the universe! So fasten your seatbelt and get ready for the journey 🚀

Are you a beginner or just a total newbie to Python? Great (not actually), cause we've collected a lot of material to help you get started.

Enjoy!
eval.gif
2.2 MB
🐍 One line calculator

print( eval(input()) ) is all you need to create a basic calculator.

eval() is a built-in Python function that allows you to evaluate arbitrary Python expressions from string-based input, including simple mathematical expressions like "2 + 2", "21 / 3" or "6 * 6".

#tips
What is the output of the code given above?
Anonymous Quiz
17%
Error
29%
-1
24%
None
29%
math.pi not defined
How to get combinations of n numbers in a list

If you need to get all possible combinations with particular length of a list's elements, simply call itertools.combinations on your list. It takes two arguments: a list and an integer value, which should be equal to the length of each combination.

#tips
What is the output of the code given above?
Anonymous Quiz
25%
'Python'
15%
['Python']
13%
None
47%
['Python', 'Python']