Python Flet error: takes 0 positional arguments but 1 was given

I am trying to create a Rock, Paper, Scissors application using Python and flet. I get:

TypeError: main.<locals>.rock() takes 0 positional arguments but 1 was given

I don’t understand what the error is telling me. I am trying to get it to change “choices_text” from “Player vs Computer” to whatever each entity chose (“Player” to player’s choice, and “Computer” to whatever the randomizer selected for the computer.) Then “winner_textField” would output who won or if it was a tie.

Here is my code so far:

import flet as ft
import random

def main(page: ft.Page):

    ############ function ##################
    def rock():
        computer = random.choice(['rock', 'paper', 'scissors'])
        if computer == 'rock':
            choices_text.value = "Rock vs Rock"
            winner_textField.value = "It's a tie!"
        elif computer == "paper":
            choices_text.value = "Rock vs Paper"
            winner_textField.value = "Computer wins!"
        else:
            choices_text.value = "Rock vs Scissors"
            winner_textField.value = "You win!"
        page.update()

    def paper():
        computer = random.choice(['rock', 'paper', 'scissors'])
        if computer == 'rock':
            choices_text.value = "Paper vs Rock"
            winner_textField.value = "You win!"
        elif computer == "paper":
            choices_text.value = "Paper vs Paper"
            winner_textField.value = "It's a tie!"
        else:
            choices_text.value = "Paper vs Scissors"
            winner_textField.value = "Computer wins!"
        page.update()
    
    def scissors():
        computer = random.choice(['rock', 'paper', 'scissors'])
        if computer == 'rock':
            choices_text.value = "Scissors vs Rock"
            winner_textField.value = "Computer wins!"
        elif computer == "paper":
            choices_text.value = "Scissors vs Paper"
            winner_textField.value = "You win!"
        else:
            choices_text.value = "Scissors vs Scissors"
            winner_textField.value = "It's a tie!"
        page.update()
        
    def reset():
        choices_text.value = "Player vs Computer"
        winner_textField.value = " "
        page.update()

    ############# page setup ################
    page.title="Rock Paper Scissors"
    page.window_width = 500
    page.window_height = 700
    page.theme_mode = "light"
    page.window_center()
    page.vertical_alignment=ft.MainAxisAlignment.SPACE_EVENLY
    page.horizontal_alignment=ft.CrossAxisAlignment.CENTER

    ########### page content ###############
    title_text = ft.Text("Rock Paper Scissors", color="BLUE", size=30)
    choices_text = ft.Text("Player vs Computer", color="BLACK", size=25)

    ########### output ###############
    winner_textField = ft.TextField(width=300, height=100, color="BLACK", text_size=20, text_align="center")    

    ########### input buttons ###############
    rock_button = ft.ElevatedButton(content=ft.ResponsiveRow([ft.Text("ROCK", size=20, text_align="center")]), width=150, height=100, bgcolor="BLUE", color="WHITE", on_click=rock)
    paper_button = ft.ElevatedButton(content=ft.ResponsiveRow([ft.Text("PAPER", size=20, text_align="center")]), width=150, height=100, bgcolor="BLUE", color="WHITE", on_click=paper)
    scissors_button = ft.ElevatedButton(content=ft.ResponsiveRow([ft.Text("SCISSORS", size=20, text_align="center")]), width=200, height=100, bgcolor="BLUE", color="WHITE", on_click=scissors)  

    ############ reset button ###############
    reset_button = ft.ElevatedButton(content=ft.ResponsiveRow([ft.Text("Reset", size=20, text_align="center")]), width=300, height=100, bgcolor="BLUE", color="WHITE", on_click=reset)


    page.add(
        title_text, 
        choices_text, 
        rock_button, 
        paper_button, 
        scissors_button, 
        winner_textField,
        reset_button
    )

ft.app(target=main)

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật