Import car in code

Bug description:

Expected vs Current Behavior:

Steps to reproduce:

Bug appears at this link: https://replit.com/~?supportform=true

Screenshot(s)/Screen Recording:

Browser/OS/Device: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36

Replit Profile: https://replit.com/@ramarcus

Hey, @ramarcus welcome to the forums!

Can you please provide a link to the repl? This way it is easier for staff and members of the community to help you!

Also see this guide on how to share your code:

1 Like

the code is correct
but replit is rejecting it

Traceback (most recent call last):
  File "/home/runner/CH-10-LABaclass-Car-a1-Car-object/main.py", line 39, in <module>
    main()
  File "/home/runner/CH-10-LABaclass-Car-a1-Car-object/main.py", line 22, in main
    drive_car = car.Car('2023', 'Range Rover')
NameError: name 'car' is not defined. Did you mean: 'Car'?

This is the error I am getting:

Traceback (most recent call last):
  File "/home/runner/3084995333/main.py", line 2, in <module>
    class Car:
  File "/home/runner/3084995333/main.py", line 19, in Car
    import car
ModuleNotFoundError: No module named 'car'
exit status 1

Which is because you don’t have a file named car.py.

1 Like