00. LPTHW (Appendix A) : Command Line Crash Course with Programming Challenge at the end, rewarding 25SBD for best solution.

in #programming7 years ago (edited)

Beginners should not skip this.

Hello everyone. I hope you're doing well. LPTHW is the acronym of the book that I'm following for this series : Learn Python The Hard Way. Today, we'll look into supposedly the scary part of the computer for beginners. The part which looks scary and difficult to deal with, the part which looks fancy to non-programmers and looks like a really cool or advanced tech. But if you learn how to make friends with your black screen, it's like a dog - very friendly, loyal and helpful. The learning curve isn't quite difficult as many perceive it.


Meet your best friend:


Press: Ctrl + Alt + T in Linux to access it.

OR


Press WindowsKey+R, then type cmd
Note: sometimes you'll have to right click and Run as administrator(Why and how? - Go Google it)

OR


Press Windows key, type Powershell. Press Enter Key or Shift + Enter


Hello Best friend!
What's the name though?

Your friend has many names. In windows operating system, you'd call it Command Prompt as you see in the second picture above. There's a variant called PowerShellas you in the third picture above. Then, we have the powerful Terminal for Linux operating system. If you already use Linux or Mac, you're most likely aware of it already.


Getting to know your friend

Now that you know what your friend looks like and what you call it, it's time to know him better. Isn't that what you'd do when you make a new friend? Ask him what he does for living, where does he work, what's his interest etc etc.
So, do the same here but your friend is most likely not going to answer those questions for you. You'll have to Google them. Ask Google about your new friend, ask questions like : "What is a terminal?" or "What is a command prompt?" or "Why do we use command prompt?" or any such things you have in your mind right now. Just google it and skim through the first few links. You will find the answers.

Seek and Ye shall find --More like--> Google and Ye shall find


BY THE BOOK

Today, you'll have to make sure you know a thing or two about your best friend properly.

TASK #1 (for beginners only, PRIZE : $1)

: Read the Appendix A: Command Line Crash Course

Type what each of the following command does in the comment below and the first correct response receives a 100% upvote from me, worth $1. :P

  1. cd
  2. mkdir
  3. ls
  4. rmdir
  5. cp
  6. mv
  7. less
  8. more
  9. cat
  10. rm
  11. touch
  12. pwd
  13. pushd
  14. popd

TASK #2 (open to all, PRIZE: 25SBD) - JUDGE AND SPONSOR @pharesim.

Write a program that prints the numbers from 1 to 100. 

But for multiples of three 
print “Steem” instead of the number 

and for the multiples of five
print “It”. 

For numbers which are multiples of both three and five 
print “SteemIt"

Please submit your solutions in the comment section below with the task number.

Judge's decision of the best solution is final. Decision will be announced after the payout of this post. In case two solutions are identical/same, the first one counts.


All the best!

-isteemit.

Sort:  
  1. cd - to change the current folder or to navigate to another folder in your computer.
  2. mkdir- to create new directory or folders
  3. ls - to list the directory

Great going! What about the other 11 though?

Let me revise them, it has been very long time I used them.

Pushd and popd similar to CD for change stack of folder but after return to older folder sorry for rude English 😂

Congratulations @isteemit! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of posts published

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

i am a java programmer and good work 😍

Hi Nomi! You can try Task#2. :)

#Take2
Language used : Ruby


(1..100). each do |i|    
    val = ""
    if(i%3==0)
        val = "Steem"
    end   
    if(i%5==0)
        val +="It"
    end
    if (val == "")
        val = i
    end
    p val
end

Great going Elishagautam! Please do mention the language you've used and format it if possible.

Nice information

interesting post, worth a try first ...

this post is so amazing, I'm so inspired to keep working hard on steem.

I have upvoted 😉

please look at my photo
Upvote my post
thank you

Task #2 (was award already given? I assume it did)

Language: Python

for number in range(1,100):
    if number%3 == 0 and number%5 == 0:
        print('SteemIt')
    elif number%3==0:
        print('Steem')
    elif number%5 == 0:
        print('It')
    else:
        print(number)

Nicely done, @veleje!
The award hasn't been given out yet. Judge will decide the winning solution at the end of the payout of this post.

Yay, I was not logged in to steemit for about two months, I just saw I got it. YES!! ;-) and thank you!