Your problem seems to be a bigger one. Try the following:
- Restart your computer
- Boot into Recovery Mode (select the "Recovery" option from the boot screen. If you're single-booting Ubuntu, you need to hold the Shift key to get to the GRUB menu)
At the prompt you see, select "Drop to root shell prompt"

At the command prompt (which should say root@your-computer:~#, enter:
chmod 0440 /etc/sudoers
Then, restart your machine
shutdown -r now
Now, you should be able to use sudo again. It seems you've tried a few wrong commands before.
Note:
Always take care that you know what you're doing when you use sudo.
Another note:
Running sudo chmod 077 /var/www/ is definitely not what you want to do. If you want to set permissions on /var/www, it would be advisable to create a new group of users that have write-access to the directory.
sudo addgroup www-users
sudo adduser <your-username> www-users
Replace <your-username> with your real username. This will add a new group www-users and add yourself to it.
Then, add the webserver user to it:
sudo adduser www-data www-users
And give the right permissions:
sudo chgrp www-users /var/www
sudo chmod –R 775 /var/www
sudo chmod g+s /var/www