#๐ ok back to trying to code stuff what do i learn?
222 messages ยท Page 1 of 1 (latest)
@chilly oar
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.
hi
What all do you know yet
how about input function
What do you want to make
tictactoe
whats that
That's quite basic you should be able to make it with what you already know
input() function allows you to take input from the user
Learn input
!e
print(a)```
The bot cant run input function directly
:x: Your 3.13 eval job has completed with return code 1.
001 | hiTraceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m1[0m, in [35m<module>[0m
003 | a=input("hi")
004 | [1;35mEOFError[0m: [35mEOF when reading a line[0m
run it in your machine
my machine is my phone
pydroid to be specific
oh hi dagger
you dont have laptop / pc?
i forgor like half the stuff you told me
no
dang
Theres python on phone
512gb tablet tho
welcome to learning
id recommend you to get one tho, even a potato laptop will work just fine
also i know for and while loops
even a raspberry pi would work
lol
just ssh / rdc into it from tablet or watever
i has pudrioid
pydroid
open
what now
do
name = input("Enter your name: ")
print("Your name is", name)
wouldn't it be print(f"Your name is", {name}) ?
alr
!e
name = "Babba"
print(f"Your name is", {name})
:white_check_mark: Your 3.13 eval job has completed with return code 0.
Your name is {'Babba'}
worked ir out
it converts it to a set
nice, you understand how it works?
yh
if you wanna use it as a fstring you can do it like this-
print(f"Your name is {name}")
yes
nice
the main thing you need to remember about input function is that it will always return the user input as a string
do you know what a string is
yeah whatever's inside the quotes is considered a string
!e
b=4
print(a+b)
a=str(a)
b=str(b)
print(a+b)
Hey @chilly oar!
Add a py after the three backticks.
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
so if you try to do any form of mathematical operation with the user input, you will have to convert it to an integer / float first
!e
a=11
b=4
print(a+b)
a=str(a)
b=str(b)
print(a+b)
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 15
002 | 114
yes
:3
i guess you already know what im talking about
yeah
very nice
lmao
ngl schools do go very slowly
if you have any specific questions you can ask
1 computer science class a week๐ญ๐ญ
dang
what do i learn now
loops
conditionally executing code
!e
print(i)
i=i*2```
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/W4BIEJX3Z7SSKCUGAKOQJ5TIMI
last line aint doing much
well ye but there is no code after that line to use that bigger value
!e
print(i)
i=i*2```
:white_check_mark: Your 3.13 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/IMELGDZ5SYF4WKDF456DSR7VOY
am big confused
print(" {} | {} | {} ".format(" ", "x", "o"))
!e
print(" {} | {} | {} ".format("a ", "b", "c"))
:white_check_mark: Your 3.13 eval job has completed with return code 0.
a | b | c
that i=i*2 is not inside loop if thats whats confusing u
why number go up by 1 and not x2
because its not inside loop
and even if it was it wouldnt work
the way for loops work is by going over the iterable u give in
in this case u gave it range(80)
that makes it so i is first 0 then next loop iteration its gonna be 1 then 2 then 3 etc. till 79 which would be last loop iteration (80 isnt included inside range)
ok
sorry i got distracted
..
my discord got hscked or dmth
ibreplied to a dm
you should reset your password
enable 2fa too
i use email protection
on my email
only way in
password+email acception
:3
@marsh radish
report them
seems like u shouldnt dm a guy that triggered a security alert . . .
howd it trigger a security alert?
do you know them?
nope
they were likely trying to hack into your account
...
nope
alr
i didnt even dm them
i tried to msg them ??
cuz they tandomly friended me
and then the ai wanted me to rpove im human to dm
yk
i click comfirm and insta get logged out
seen it loads
<@&831776746206265384>
quick security tip: if a random tries to friend u then its best to ignore
there is a reason i got it like this . . .
just click ignore
they have an ignore button nowadays ?
They probably trying to sniff out emails to hack into lmao
sure
@split bloom
huh its called ignore now
i swear it was reject/deny before
Build and Run your Python code instantly. Online-Python is a quick and easy tool that helps you to build, compile, test your python programs.
anyways back to python, does this make sense
yes
we use this in class btw
also if i disappear its cuz am eepy
you should go sleep then
cant
?
true that
be careful online guys
if only I could had the skillz ๐
why did you send them a friend request?
ive never spoken to them before either
I didn't want to reply to this though since you guys seem to have it handled
it pings moderators
just a tip: stop sending random friend request. People who do that are most likely scammers/hackers. Instead take part in conversations and make friends that way.
okayyy
will do
mb sowwy
tell me whats going on
basically
uhh
@marsh radish friend requested me
i dmed asking why
then
i got insta logged out
i reset password and logged back in
good
literally frames after
and their website looks a bit sketchy lol
it hhappends from time to time, just ignore it
yeahhh it's my first one
I made it in 36 hours
but whyd i get logged out for tryna dm sm1
(respond for why they added me)
use discords friend list for what it is for
whats it fot
anyways @split bloom gn and @hidden timber
!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.