#πŸ”’ yo what should i learn nexts

83 messages Β· Page 1 of 1 (latest)

cold smelt
#

so i just learned the basic tkitler so what should i learn next i made some projects like calculator but now i am lost

vapid sparrowBOT
#

@cold smelt

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

bleak rivet
cold smelt
#

like my first goal is to make an app or a ai

bleak rivet
#

what kind of app?

cold smelt
#

chatbot or nureal network

cold smelt
#

kind

bleak rivet
#

What other interests do you have? Anything that you can find an overlap with python for?

cold smelt
#

like

bleak rivet
#

If you like cooking for example, maybe a recipe organizer or measurement converter

cold smelt
#

no like wha should i learn next

#

after the basic and stuff

bleak rivet
#

I don't know what you already know

#

how long have you been learning python?

cold smelt
#

like 3 months

#

i learned arrasy if stats for loops while loops

#

string string manu

#

and binary search

bleak rivet
#

Variable Assignment
Receiving Input
Type Conversion
Strings
Formatted Strings
String Methods
Comments
Arithmetic Operations
Math Functions
If Statements
Logical Operators
Comparison Operators
While Loops
For Loops
Nested Loops
Lists
2D Lists
List Methods
Tuples
Dictionaries
Functions
Parameters/Arguments
Return Statement
Exceptions
Generating Random Values
File Handling
Classes

#

This is a list of what I'd consider "the basics" that everyone needs to learn

cold smelt
#

ok

#

il check if i am good at these stuff

#

ik everything but file handling

bleak rivet
#

can you share your calculator code?

cold smelt
#

kkay

sage mango
sage mango
cold smelt
#

from tkinter import *
root = Tk()
root.title("calculater i think with gui not terminal")
e = Entry(root,width=35 , borderwidth= 5)
e.grid(row=0,column=0,columnspan=3,padx=5 ,pady = 5)

def button_click(number):
current = e.get()
e.delete(0,END)
e.insert(0,str(current) + str(number))
def button_clear():
e.delete(0, END)
def button_add():
first_num = e.get()
global ft_num
global math
math = "add"
ft_num = int(first_num)
e.delete(0,END)
def button_equal():
second_number = e.get()
e.delete(0,END)
if math == "add":
e.insert(0,ft_num + int(second_number))
if math == "sub":
e.insert(0,ft_num - int(second_number))
if math == "div":
try:
e.insert(0,ft_num / int(second_number))
except ZeroDivisionError:
e.insert(0,"erore code 0 zero divison")
if math == "multi":
e.insert(0,ft_num * int(second_number))
def button_multi():
first_num = e.get()
global ft_num
global math
math = "multi"
ft_num = int(first_num)
e.delete(0,END)
def button_sub():
first_num = e.get()
global ft_num
global math
math = "sub"
ft_num = int(first_num)
e.delete(0,END)
def button_div():
first_num = e.get()
global ft_num
global math
math = "div"
ft_num = int(first_num)
e.delete(0,END)

vapid sparrowBOT
#

Hey @cold smelt!

Please edit your message to use a code block

```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
cold smelt
#

theres more

#

oh thanks

#

'''py

bleak rivet
#

Use a paste link to share

#

!paste

vapid sparrowBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

cold smelt
#

k

#

!paste

#

k?

bleak rivet
#

perfect

cold smelt
#
print('yay')
bleak rivet
#

this might be a good time to learn that you can create buttons using loops πŸ™‚

cold smelt
#

what...

bleak rivet
#

so instead of making 10 numbered buttons

#

you can just use a loop to create them

cold smelt
#

for loops?

#

or while loop?

bleak rivet
#

which do you think?

cold smelt
#

for loop lol

bleak rivet
#

when do you use for and when do you use while?

cold smelt
#

while checks if its true

#

for checks if i is out of range

#

so for ofc

bleak rivet
#

not quite the correct way to think about them

#

while is when we don't know immediately when the loop should end

#

it is called an "indefinite loop"

cold smelt
#

and to iterate a string an arrays

bleak rivet
#

for is when we want to apply something a fixed number of times (like once per object in a list)

cold smelt
#

k

bleak rivet
#

it is called a "definite loop"

cold smelt
#

kay

bleak rivet
#

we know we want 10 numbered buttons, therefore, we should use for

cold smelt
#

yay

#

but how lol

#

for i in range(10): now what

bleak rivet
#
import tkinter as tk


root = tk.Tk()

for i in range(9):
    btn = tk.Button(text=str(i + 1), padx=15, pady=15)
    btn.grid(row=i // 3, column=i % 3, padx=2, pady=2)


root.mainloop()
#

try running this

cold smelt
#

k?

#

ohhh

#

but what if i wanted to a patern like i did with my code

bleak rivet
#

you can still add the remaining buttons without the loop

#

but this definitely saves from repeating for the number buttons

cold smelt
#

Yo sry I had to go

#

But I can't talk rn

cold smelt
#

yea i came back'

bleak rivet
cold smelt
#

Nothing much

bleak rivet
cold smelt
#

K

#

!close

vapid sparrowBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.