#🔒 ALEVEL HELPER/TUTOR PLEASE
189 messages · Page 1 of 1 (latest)
@slender plank
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.
This is like an SOS call I’m in serious need of help
if you have a specific question ask here and someone will help
@reef mountain
Yes
I need help learning to code
Okay, what have you been covering so far?
Like count controlled loops
No while
Okay.
Have you covered the concept of object oriented programming?
What is an object?
What is a type?
What is a method?
Yess
Okay, great.
Can u do vc help?
Have you covered assignment?
I can, yes. You may not be able to, however, just yet.
Yes
Ye ik
Can I stream
Oh
I don't do DMs.
Have you covered the concept of assignment?
var = obj```
var = 1 + 1```
etc
Yah
I can hear u
Can I dm call
Okk
I understand assignments
Yah I get loops basically I will share my code in a sec
I have done all loops I just don’t get returns and prints
!e ```py
def func():
return 'Hello, world.'
print(func())```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Hello, world.
Ohh ok I understand
Can I stream my code
It’s not working
Ok can I send pictures
!paste
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.
!code
This is the task
I dont understand
this is what I have done so far and my input doesnt output or work
What does iterate over the string
Also idk why my code doesn’t work the first part
!e py number = 123 as_string = str(number) for character in as_string: print(character)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
Can I see the mod option
!d divmod
divmod(a, b)```
Take two (non\-complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as `(a // b, a % b)`. For floating\-point numbers the result is `(q, a % b)`, where *q* is usually `math.floor(a / b)` but may be 1 less than that. In any case `q * b + a % b` is very close to *a*, if `a % b` is non\-zero it has the same sign as *b*, and `0 <= abs(a % b) < abs(b)`.
Your function should take a number as an argument
It shouldn't call input()
Idk what that means
def func(n):
...
result = func(7)
print(result)```
.
Ok I understand
!argument
Your function should take one number as the argument
!e py value = 123 a = value // 10 b = value % 10 print(a) print(b)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 12
002 | 3
I don’t understand
I need to input 3 values
Currently you take 3 numbers as arguments, you should only take one
!e py value = 123 a, b = divmod(value, 10) print(a) print(b)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 12
002 | 3
Why
Look at this
Which one is the function is it the thing that holds the parameter
Yes, the table isn't helping. Some numbers are known to have more than 3 digits
Try to use lower case for arguments, variables and functions
is_happy
You need to extract the digits from the number
Idk what an argument is
Ok I understand now thanks
Well just use lower case for everything except classes
Idk what a class is
Well just use lower case for everything, and then when you find out what a class is you'll know
We're in voice btw.
Ok thanks @inland vortex
when u guys are done i have this code:
import random
secretNum = random.randint(1, 100)
print("Try to guess my secret number!")
print("You only get 10 guesses.")
count = 0
guess = 0
while guess != secretNum and count <= 10:
try:
guess = int(input("\n>>"))
except ValueError:
guess = int(input("the secret number is an integer\n\n>>"))
while guess > 100 or guess < 1:
guess = int(input("Try choosing a number from 1 to 100\n\n>>"))
count += 1
if guess < secretNum:
print("Too Low")
if guess > secretNum:
print("Too High")
if count >= 10:
print("Game Over ... guess limit exceeded!")
else:
print("Correct! You only took " + str(count) + " guesses!")
Hey @rancid hamlet!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
open a separate post
Not here please
how do I create a new one
#❓|how-to-get-help
Ok
Okkk
What is the next step for my code
Idk how to apply MOD
or do the calculations
Or do anything in rlly stuck
Okk
Indentation.
So ** is square
value ** 2
!code
#Subroutine that answer calculates whether its a happy number or not
def is_happy(Number):
Result = N12 + N22
return Result
FinValue = HappyorSadNumber(1,9,0)
Hey @slender plank!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
Where is the example
#Subroutine that answer calculates whether its a happy number or not
#Subroutine that answer calculates whether its a happy number or not
def is_happy(Number):
Result = N1**2 + N2**2
return Result
is_happy(19)
!e ```py
def func(obj):
print(obj)
func('Hello, world.')```
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Hello, world.
sorry i forgot to change it
Ok
Gimme a sec
I’m not sure
Wait
I’m trying
I don’t get it
Sorry
No I don’t get what is floor division
Yes pls write it
1.4
!e py print(10 / 6)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
1.6666666666666667
!e py print(10 // 6)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
1
!e py print(10 % 6)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
4
It’s the remainder
!e py print(52765 // 10) print(52765 % 10)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 5276
002 | 5
How did u do this
:white_check_mark: Your 3.12 eval job has completed with return code 0.
(1234, 5)
!e py a, b = (1234, 5) print(a) print(b)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1234
002 | 5
!e py a, b = divmod(12345, 10) print(a) print(b)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1234
002 | 5
!e py if True: print('Hello, world.')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Hello, world.
!e py if False: print('Hello, world.')
:warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e py while True: print('Hello, world.') break print('Bye.')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Hello, world.
002 | Bye.
!e py while False: print('Hello, world.') break print('Bye.')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Bye.
!e py if 1: print('A') else: print('B')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
A
!e py if 0: print('A') else: print('B')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
B
!e py value = 123 while value > 0: value = value - 1 print('Bye.')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Bye.
!e py value = 123 while value: value = value - 1 print('Bye.')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Bye.
!e py if -1: print('Hello, world.')
:white_check_mark: Your 3.12 eval job has completed with return code 0.
Hello, world.
@slender plank 👋
Thanks for trying to help
I might go to sleep now since I’m super tired
Can u help again later?
Thank u so much!
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.