21 August 2025
22 August 2025
23 August 2025
can anyone help me find the cause of the loop plz
m=0
from itertools import product
ss=[]
for t in product ('012', repeat=49) :
t=str(''.join(t))
if t.count('0') ==19 and t.count('1') ==13:
ss.append(t)
for s in ss:
while '10' in s or '20' in s:
if '20' in s:
s=s.replace('20', '00', 1)
else:
s=s.replace('10', '200', 1)
if s.count ('0') >m:
m=s.count('0')
print(m)
янеугадываcan anyone help me find the cause of the loop plz
m=0
from itertools import product
ss=[]
for t in product ('012', repeat=49) :
t=str(''.join(t))
if t.count('0') ==19 and t.count('1') ==13:
ss.append(t)
for s in ss:
while '10' in s or '20' in s:
if '20' in s:
Try testing with shorter strings first to see if the logic works
янеугадываcan anyone help me find the cause of the loop plz
m=0
from itertools import product
ss=[]
for t in product ('012', repeat=49) :
t=str(''.join(t))
if t.count('0') ==19 and t.count('1') ==13:
ss.append(t)
for s in ss:
while '10' in s or '20' in s:
if '20' in s:
Have you tried tracing through the code yourself to understand what it’s trying to do ?
Guys it's been 1 day since I start python and I do this code is it good tho ? print("Welcome To Calculator App\n")
2 num1=float(input("First Number: "))
3 num2=float(input("Second Number: "))
4 print("|-----------------------|")
5 print("Adding"+str(num1+num2))
6 print("subtract"+str(num1-num2))
7 print("multiple"+str(num1*num2))
8 print("divide s"+str(num1/num2))
9 print("modulus"+str(num1%num2))
id 7412086509Guys it's been 1 day since I start python and I do this code is it good tho ? print("Welcome To Calculator App\n")
2 num1=float(input("First Number: "))
3 num2=float(input("Second Number: "))
4 print("|-----------------------|")
5 print("Adding"+str(num1+num2))
6 print("subtract"+str(num1-num2)
things you can improve for this specific use case:
- prints in line 5-9 could be print("...", num1 ... num2) {replace triple dots accordingly}
- catch the exception raised when the input is not a number {try run your code and give any string as input}
24 August 2025
id 7412086509Guys it's been 1 day since I start python and I do this code is it good tho ? print("Welcome To Calculator App\n")
2 num1=float(input("First Number: "))
3 num2=float(input("Second Number: "))
4 print("|-----------------------|")
5 print("Adding"+str(num1+num2))
6 print("subtract"+str(num1-num2)
It's actually good
This is a basic calculator
id 7412086509Guys it's been 1 day since I start python and I do this code is it good tho ? print("Welcome To Calculator App\n")
2 num1=float(input("First Number: "))
3 num2=float(input("Second Number: "))
4 print("|-----------------------|")
5 print("Adding"+str(num1+num2))
6 print("subtract"+str(num1-num2)
but i have a q, why do u started with py, that is bec it the most popular lang, or bec u will use it in the future, u have to know ur filed before just going to any lang! why u r learning python?
id 7565750369but i have a q, why do u started with py, that is bec it the most popular lang, or bec u will use it in the future, u have to know ur filed before just going to any lang! why u r learning python?
Well I've search every lang and I found the easiest one is py and ofc I will learn another language in the future and i start py because I will use it a lot on Kali Linux
inchidithings you can improve for this specific use case:
- prints in line 5-9 could be print("...", num1 ... num2) {replace triple dots accordingly}
- catch the exception raised when the input is not a number {try run your code and give any string as input}
And for the divide by zero scenario in the divide operation.
id 7297630070Hi everyone, I'm student of first year and new to python, want to learn it for part-time earning. I even don't know basics, will you please guide me where to start and how much time it will take, is there any free course available. 🙂
What’s ur major? I majored in civil engineering in university and learned Python in the first year of university. It takes me half and a year to get the first bucket of gold. Now I have worked as a programmer for 2 years
Is that related to programming? As for me, it’s hard to insist on learning programming for earning in part time job. I wanna be a hacker when I started to learn Python. But after basic grammar finished, I gave it up and turned to learn web scraping, then backend, automation. I learned computer science courses from the second year, data structures, algorithms, computer networks, database, front end
id 7190522705If u wanna earn money in part time job, I don’t recommend u to learn python. The return is less than the input
The return is less than the input, I said it wrongly
id 7190522705The return is less than the input, I said it wrongly
Telegram allows you to edit your messages. It also allows to reply to message so that the context of the conversation isn't lost.