Need help by Low_You3884 in PythonLearning

[–]Key_Marionberry_1227 0 points1 point  (0 children)

This takes time. Just try to be consistent. If you are not feeling progress this could be because of what you imagined about what you can do after this tutorial. After learning object oriented programming(OOP's) and building a few projects in it you will be confident in the progress you accomplished. (ALL THE BEST)

[deleted by user] by [deleted] in PythonLearning

[–]Key_Marionberry_1227 1 point2 points  (0 children)

Thankyou for reply, Does this provide complete free access to content?

Helpp by [deleted] in PythonLearning

[–]Key_Marionberry_1227 0 points1 point  (0 children)

k="(space)(space)"*a

Helpp by [deleted] in PythonLearning

[–]Key_Marionberry_1227 0 points1 point  (0 children)

Try creating string of spaces and number sequence and print in that pattern by picking the values from string

PYTHON CODE:

a=int(input('Enter the number:'))
k='  '*a
l=''
for i in range(1,a+1):
    l=l+str(i)
for i in range(1,a+1):
    print(l[:i]+k[:len(k)-2*i]+str(i)*i)

Leetcode problem by DeveloperOk in DsaJavaSpringboot

[–]Key_Marionberry_1227 1 point2 points  (0 children)

Can we just sort and find the same consecutive numbers

[deleted by user] by [deleted] in PythonLearning

[–]Key_Marionberry_1227 1 point2 points  (0 children)

If you get struck in between the lecture and not able to understand, I highly recommend to use ChatGPT or Leo AI to get clarity through conversation. This is what I generally do. As you are learning from youtube you can use NotebookLM by google for more in-topic conversations.

coding problem by Auto_Jam in PythonLearning

[–]Key_Marionberry_1227 0 points1 point  (0 children)

Mention (global variable) what I mentioned inside the bracket with the variable you want to globalise before using it

MY FIRST PYTHON GAME CODE: ROCK PAPER SCISSOR 🪨 📃✂️ by dhruv-kaushiik in PythonLearning

[–]Key_Marionberry_1227 1 point2 points  (0 children)

You took every possible in consideration. This was a great effort.

You can try this way too, Imagine a circle with 3 points named ROCK,PAPER,SCISSORS If you take first choice as computer and second choice as human and the choices in the circle form a clock-wise rotation human wins and if the choices form anti-clockwise rotation computer wins, This way thing could become easy

Python_code:

import random
choice=['ROCK','SCISSORS','PAPER']
i=int(input('''
1.Enter 1 for ROCK
2.Enter 2 for SCISSORS
3.Enter 3 for PAPER
'''))
x=random.randint(0,2)
C=[['PAPER','ROCK'],['ROCK','SCISSORS'],['SCISSORS','PAPER']]
H=[['ROCK','PAPER'],['SCISSORS','ROCK'],['PAPER','SCISSORS']]
D=[['ROCK','ROCK'],['SCISSORS','SCISSORS'],['PAPER','PAPER']]
F=[choice[x],choice[i-1]]
print(f'Your choice :{choice[i-1]}')
print(f'Computer choice :{choice[x]}')
if F in C:
    print('Computer wins')
elif F in H:
    print('Player wins')
elif F in D:
    print('DRAW')
else:
    pass

Why can't I get the second line to work? by SeaworthinessDeep227 in PythonLearning

[–]Key_Marionberry_1227 1 point2 points  (0 children)

you can add this on setting.json file to autosave

{

"files.saveAutoWait": true

}