#🔒 ALEVEL HELPER/TUTOR PLEASE

189 messages · Page 1 of 1 (latest)

slender plank
#

Can someone PLEASE help me learning to code for my ALEVEL exams I don’t understand anything and I’m super sad

crisp deltaBOT
#

@slender plank

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.

slender plank
#

This is like an SOS call I’m in serious need of help

midnight jacinth
#

if you have a specific question ask here and someone will help

inland vortex
#

@reef mountain

slender plank
slender plank
inland vortex
slender plank
inland vortex
#

Okay, so for and range.

#

Yes?

slender plank
#

No while

inland vortex
#

Okay.

#

Have you covered the concept of object oriented programming?

#

What is an object?

#

What is a type?

#

What is a method?

inland vortex
#

Okay, great.

slender plank
#

Can u do vc help?

inland vortex
#

Have you covered assignment?

#

I can, yes. You may not be able to, however, just yet.

slender plank
inland vortex
#

In terms of speaking.

#

You can listen, though.

slender plank
#

Can I stream

inland vortex
#

No.

#

Not without moderator intervention.

slender plank
#

Oh

inland vortex
#

I don't do DMs.

#

Have you covered the concept of assignment?

#
var = obj```
#
var = 1 + 1```
#

etc

slender plank
#

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

inland vortex
#

!e ```py
def func():
return 'Hello, world.'

print(func())```

crisp deltaBOT
slender plank
#

Ohh ok I understand

#

Can I stream my code

#

It’s not working

#

Ok can I send pictures

fluid pollen
#

!paste

crisp deltaBOT
#
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.

inland vortex
#

!code

crisp deltaBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

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

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

slender plank
#

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

inland vortex
#

!e py number = 123 as_string = str(number) for character in as_string: print(character)

crisp deltaBOT
slender plank
#

Can I see the mod option

inland vortex
#

!d divmod

crisp deltaBOT
#

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)`.
compact birch
#

It shouldn't call input()

slender plank
slender plank
#

*this

inland vortex
#
def func(n):
    ...

result = func(7)
print(result)```
slender plank
compact birch
#

!names

#

Hmm there's a nice little animation

slender plank
compact birch
#

!argument

compact birch
inland vortex
#

!e py value = 123 a = value // 10 b = value % 10 print(a) print(b)

crisp deltaBOT
slender plank
#

I need to input 3 values

compact birch
#

Currently you take 3 numbers as arguments, you should only take one

inland vortex
#

!e py value = 123 a, b = divmod(value, 10) print(a) print(b)

crisp deltaBOT
slender plank
#

Which one is the function is it the thing that holds the parameter

compact birch
#

Yes, the table isn't helping. Some numbers are known to have more than 3 digits

slender plank
#

i did this

#

is this right

compact birch
#

Try to use lower case for arguments, variables and functions

inland vortex
#

is_happy

compact birch
#

You need to extract the digits from the number

slender plank
#

Ok I understand now thanks

compact birch
#

Well just use lower case for everything except classes

slender plank
compact birch
#

Well just use lower case for everything, and then when you find out what a class is you'll know

inland vortex
#

We're in voice btw.

slender plank
#

Ok thanks @inland vortex

rancid hamlet
#

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!")

crisp deltaBOT
#

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.
fluid pollen
rancid hamlet
#

how do I create a new one

fluid pollen
slender plank
#

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

inland vortex
#

Compound statement.

#

:

slender plank
#

Okk

inland vortex
#

Indentation.

slender plank
#

I see

#

Do I press tab

inland vortex
#

**

#

^

slender plank
#

So ** is square

inland vortex
#

value ** 2

slender plank
#

Okkk

inland vortex
#

!code

crisp deltaBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

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

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

slender plank
#

#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)

crisp deltaBOT
#

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.
slender plank
#

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)





inland vortex
#

!e ```py
def func(obj):
print(obj)

func('Hello, world.')```

crisp deltaBOT
slender plank
#

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

inland vortex
#

!e py print(10 / 6)

crisp deltaBOT
inland vortex
#

!e py print(10 // 6)

crisp deltaBOT
slender plank
#

Okk

#

1 more

inland vortex
#

!e py print(10 % 6)

crisp deltaBOT
slender plank
#

It’s the remainder

inland vortex
#

!e py print(52765 // 10) print(52765 % 10)

crisp deltaBOT
inland vortex
#

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

#

!e py print(divmod(12345, 10))

crisp deltaBOT
inland vortex
#

!e py a, b = (1234, 5) print(a) print(b)

crisp deltaBOT
inland vortex
#

!e py a, b = divmod(12345, 10) print(a) print(b)

crisp deltaBOT
inland vortex
#

!e py if True: print('Hello, world.')

crisp deltaBOT
inland vortex
#

!e py if False: print('Hello, world.')

crisp deltaBOT
inland vortex
#

!e py while True: print('Hello, world.') break print('Bye.')

crisp deltaBOT
inland vortex
#

!e py while False: print('Hello, world.') break print('Bye.')

crisp deltaBOT
inland vortex
#

!e py if 1: print('A') else: print('B')

crisp deltaBOT
inland vortex
#

!e py if 0: print('A') else: print('B')

crisp deltaBOT
inland vortex
#

!e py value = 123 while value > 0: value = value - 1 print('Bye.')

crisp deltaBOT
inland vortex
#

!e py value = 123 while value: value = value - 1 print('Bye.')

crisp deltaBOT
inland vortex
#

!e py if -1: print('Hello, world.')

crisp deltaBOT
inland vortex
#

@slender plank 👋

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!

crisp deltaBOT
#
Python help channel closed

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.