# Complete beginner needs help

**URL:** <https://discuss.python.org/t/complete-beginner-needs-help/20266>\
**Category:** Python Help\
**Tags:** help\
**Created:** [October 24, 2022, 12:43pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266 "2022-10-24T12:43:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [October 24, 2022, 12:43pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/1 "2022-10-24T12:43:06Z")

</div>

Hello World (…;)))

I just started with Python. I am a absolute beginner. Started with the beginner tutorial of “Programming with Mosh”. Iam working on this car game with a while loop. Somehow the coding doesnt seems to be correct. When I enter the input words nothing happens.

Maybe one of you can see my fault.

 ![Problem](https://us1.discourse-cdn.com/flex002/uploads/python1/original/2X/f/f13e3a8aac56f1da396f1a379a2a07f1cc9b1f9b.jpeg)

---

<div class="post-metadata">

**Author:** ![abessman](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/abessman/32/8367_2.png) [@abessman](https://discuss.python.org/u/abessman)\
**Post date:** [October 24, 2022, 1:41pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/2 "2022-10-24T13:41:31Z")

</div>

Code looks OK. But please don’t post screenshots of code, paste the actual code within triple backticks:

````nohighlight
```
Your code goes here.
```

````

Looks like you’re using VScode. I don’t use it for Python development personally, but could it be that the output gets printed in the OUTPUT tab in the bottom pane?

---

<div class="post-metadata">

**Author:** ![vbrozik](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vbrozik/32/7423_2.png) [@vbrozik](https://discuss.python.org/u/vbrozik)\
**Post date:** [October 24, 2022, 2:25pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/3 "2022-10-24T14:25:42Z")

</div>

Which shell are you running inside the terminal? You are using it as PowerShell but the prompt does not look like the default PowerShell prompt. On my Windows 10 it looks like below - followed by showing the PowerShell version.

```nohighlight
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\vaclav.brozik>
PS C:\Users\vaclav.brozik> $PSVersionTable

Name Value
---- -----
PSVersion 5.1.19041.1682
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1682
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

```

…also your Python installation location is weird. By default it is in `C:\Program Files\` on Windows. I have `python.exe` in my path:

```nohighlight
PS C:\Users\vaclav.brozik> Get-Command python | Format-Table -AutoSize

CommandType Name Version Source
----------- ---- ------- ------
Application python.exe 3.10.1150.1013 C:\Program Files\Python310\python.exe

```

Running Python in interactive mode from PoweShell:

```nohighlight
PS C:\Users\vaclav.brozik> python
Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 1 + 2
3
>>>

```

---

<div class="post-metadata">

**Author:** ![aivarpaalberg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/aivarpaalberg/32/9457_2.png) [@aivarpaalberg](https://discuss.python.org/u/aivarpaalberg)\
**Post date:** [October 24, 2022, 2:33pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/4 "2022-10-24T14:33:02Z")

</div>

Some observations about code:

- until ‘quit’ is entered it will be looping indefinitely i.e. if ‘start’ is entered, it prints ‘Car starts’ and prompts for the next entry with the next iteration of the loop
- when ‘quit’ entered it will print out “Sorry we don’t understand” before stopping the loop

Are these behaviors desirable or not?

---

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [October 24, 2022, 2:46pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/5 "2022-10-24T14:46:05Z")

</div>

I think I need to change program. I had some issues before with VScode and stuff that didnt worked out. I will de-install VScode. And will install a different code program and try again. Thx for youre help!!

Next time I will enter my code. 🙂

---

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [October 24, 2022, 2:47pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/6 "2022-10-24T14:47:03Z")

</div>

Thanks allot. I will give it a try in a different coding program.

---

<div class="post-metadata">

**Author:** ![vbrozik](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vbrozik/32/7423_2.png) [@vbrozik](https://discuss.python.org/u/vbrozik)\
**Post date:** [October 24, 2022, 2:54pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/7 "2022-10-24T14:54:27Z")

</div>

The problem is not in VS Code. First try to run Python in interactive mode in a terminal on your computer - as I have shown above. 🙂

---

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [October 24, 2022, 3:40pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/8 "2022-10-24T15:40:08Z")

</div>

It is working now!! Thanks allot.

---

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [October 27, 2022, 3:02pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/9 "2022-10-27T15:02:20Z")

</div>

I upgraded a old computer from windows 7 to windows 10.  
Now I can work on a big screen.  
Had to reinstall python again. Using it again in Visual Studio Code.  
A new problem occured.

When I enter arithmetic operations like: += or \> I am getting this message:

File “c:\Users\Gebruiker\4. Opdracht Lists.py”, line 6, in   
if number \> max:  
TypeError: ‘\>’ not supported between instances of ‘int’ and ‘list’

Do I need to install some package to let these operations work?  
Already did some research on the web but couldnt find a solution.

---

<div class="post-metadata">

**Author:** ![midlindner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/midlindner/32/9545_2.png) [@midlindner](https://discuss.python.org/u/midlindner)\
**Post date:** [October 27, 2022, 5:13pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/10 "2022-10-27T17:13:08Z")

</div>

> [@Sybe](#):
>
> Do I need to install some package to let these operations work?

The error is telling you that your variable, `max` is assigned to a list. How would you compare an int to a list, and determine whether the int is greater than the list?

Perhaps you meant to compare the int with an individual element of the list?

---

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [October 28, 2022, 6:31am UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/11 "2022-10-28T06:31:38Z")

</div>

```auto
numbers = [1,4,6,7,12,565,21,346,234,5,24,12,1223]
max = numbers [0]
for number in numbers:
    if number > max:
        max = numbers
print(max)

```

This is the code I wrote. Not sure but looks correct to me.

---

<div class="post-metadata">

**Author:** ![abdnafees](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/abdnafees/32/9551_2.png) [@abdnafees](https://discuss.python.org/u/abdnafees)\
**Post date:** [October 28, 2022, 6:56am UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/12 "2022-10-28T06:56:03Z")

</div>

You will have to assign `number` to `max` not `numbers`.

---

<div class="post-metadata">

**Author:** ![aivarpaalberg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/aivarpaalberg/32/9457_2.png) [@aivarpaalberg](https://discuss.python.org/u/aivarpaalberg)\
**Post date:** [October 28, 2022, 6:57am UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/13 "2022-10-28T06:57:04Z")

</div>

Don’t use built-in names. In this particular case [max](https://docs.python.org/3/library/functions.html#max) happens to have functionality what you have tried to code.

---

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [October 28, 2022, 7:09am UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/14 "2022-10-28T07:09:01Z")

</div>

```auto
numbers = [1,4,6,7,12,565,21,346,234,5,24,12,1223]
max = numbers [0]
for number in numbers:
    if number < max:
        max = numbers
print(max)

```

If I search for the smallest number in the numbers it works. I really dont get it.

---

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [October 28, 2022, 7:15am UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/15 "2022-10-28T07:15:34Z")

</div>

yes youre right.  
Theres a mistake in it. I will figure out.  
Because if I change 1 to 100 it gives the same error.

---

<div class="post-metadata">

**Author:** ![abdnafees](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/abdnafees/32/9551_2.png) [@abdnafees](https://discuss.python.org/u/abdnafees)\
**Post date:** [October 28, 2022, 7:16am UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/16 "2022-10-28T07:16:44Z")

</div>

> [@Sybe](#):
>
> If I search for the smallest number in the numbers it works. I really dont get it.

Try this:

```auto
numbers = [1,4,6,7,12,565,21,346,234,5,24,12,1223]
maximum = 0
for number in numbers:
    if number > maximum:
        maximum = number
print(maximum)

```

---

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [October 28, 2022, 7:41am UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/17 "2022-10-28T07:41:52Z")

</div>

> [@abdnafees](#):
>
> ```auto
> numbers = [1,4,6,7,12,565,21,346,234,5,24,12,1223]
> maximum = 0
> for number in numbers:
> if number > maximum:
> maximum = number
> print(maximum)
> 
> ```

Thank you so much. It is all about the details…😉

---

<div class="post-metadata">

**Author:** ![abdnafees](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/abdnafees/32/9551_2.png) [@abdnafees](https://discuss.python.org/u/abdnafees)\
**Post date:** [October 28, 2022, 7:42am UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/18 "2022-10-28T07:42:31Z")

</div>

> [@Sybe](#):
>
> Thank you so much. It is all about the details…😉

No problem. Happy to help.

---

<div class="post-metadata">

**Author:** ![midlindner](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/midlindner/32/9545_2.png) [@midlindner](https://discuss.python.org/u/midlindner)\
**Post date:** [October 31, 2022, 8:01pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/19 "2022-10-31T20:01:17Z")

</div>

> [@Sybe](#):
>
> looks correct to me

I see that you’ve found a working solution, but I’m not sure if you realize what the original problem was.  
Looking at your code, and the error message you originally posted,

> [@Sybe](#):
>
> TypeError: ‘\>’ not supported between instances of ‘int’ and ‘list’

Consider:

```python
numbers = [1,4,6,7,12,565,21,346,234,5,24,12,1223]
max = numbers [0]
for number in numbers:
    if number > max:
        max = numbers #what is this line doing?
print(max)

```

The first iteration of the for loop works fine. Your `if` statement compares the first element of `numbers` which is `1` with the value `max` is assigned to which is `numbers[0]` also `1`. Then you assign `max` to `numbers`. What is `numbers`? It’s the entire list. On the second iteration of your `for` loop, the error is thrown when you try to compare the 2nd element of `numbers` with `max` which is now assigned to the list, `numbers`.

Reading and understanding the error messages provided by Python, and using the information provided to debug your code is an extremely valuable skill to develop.

---

<div class="post-metadata">

**Author:** ![Sybe](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sybe/32/9543_2.png) [@Sybe](https://discuss.python.org/u/Sybe)\
**Post date:** [November 2, 2022, 1:34pm UTC](https://discuss.python.org/t/complete-beginner-needs-help/20266/20 "2022-11-02T13:34:00Z")

</div>

Thank you for this comment. These error messages are really helpfull.
