"Ну и как же нам перекидывать строки ви числа?" спросите вы. Проверять каждый символ, очистив строку от лишних знаков и точек. Потом конвертить допустимые символы в числа и восстанавливать знак, дробную чусть и тд???
Самый быстрый способ это просто "попробовать" 😜
text = "-0.3"
try:
num = float(text)
except ValueError:
print('Dough!')
Всё остальное это уже парсинг и разбор символов для иных целей.
#basic
Caramelized Shallots Pumpkin Pasta 🎃🍝
Recipe for 2 servings
Ingredients:
- 1/2 Hokkaido pumpkin 🎃
- 250 g pasta 🍝
- 250 g shallots 🧅
- Vegan butter for frying 🧈
- 25 ml maple syrup 🍁
- 100 g vegan cream cheese 🌱
- 300 ml vegetable stock 🥕🍲
- Pinch of salt and pepper 🧂
Toppings
- Parsley, chopped 🌿
Preparation:
1. Dice the pumpkin and blanch for 10 minutes 🍲
2. Cook the pasta 🍝
3. Fry the shallots in butter, add maple syrup for a caramelized touch 🍁🧅
4. Deglaze with vegetable stock, add the pumpkin, stir, and simmer briefly 🎃🍲
5. Stir in the cream cheese, then mix in the pasta 🌱🍝
6. Top with fresh parsley and enjoy! 🌿✨
#VeganPasta#PumpkinSeason#CaramelizedShallots#ComfortFood#FallRecipes#PlantBased#EasyMeals#Yummy#PastaNight
@dishes