Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,151,264 members, 7,811,741 topics. Date: Sunday, 28 April 2024 at 06:35 PM |
Nairaland Forum / Stealthtiger's Profile / Stealthtiger's Posts
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (of 11 pages)
Programming / Re: An Online Compiler, Interpreter And IDE For Nairaland by stealthtiger(m): 7:19am On May 05, 2017 |
G |
Programming / Re: An Online Compiler, Interpreter And IDE For Nairaland by stealthtiger(m): 11:24pm On May 04, 2017 |
dhtml18:Stackoverflow is also a forum |
Programming / Re: Learn Python- Introduction To Programming by stealthtiger(m): 11:00pm On May 04, 2017 |
promisedeco:1. The user here is the person making use of your program. Let's say you need the name person making use of your program to output Hello + the persons name. name = input('Enter your name: ') print ("Hello", name) When you run this code it asks for your name. Which is the person using the code Enter name: Satya Nadella Hello Satya Nadella. Remember: inputs normally accept string characters. But they can be tweaked to accept float and integers. age = int(input("Enter age: " So if you enter an integer Python doesn't throw an error because you told the input function to accept an integer. 2. Floats are numbers that have non whole numbers attached to them . They're non integers ie they're are not whole numbers because they contain decimal points in them. Eg 0.5, 0.67, 43.78 are floats 3. % means modulo. The modulo works on integers and yields the remainder when the first operands s divided by the second. 6%4 would yield 2. Because 2 is the remainder The or means if either one of the conditions is true then the statement is True. 7<5 or 5==1 this statement is true because the first condition is true irrespective of the fact that the second is false. As long as on condition is True either first or second then the whole statement is True. |
Programming / Re: An Online Compiler, Interpreter And IDE For Nairaland by stealthtiger(m): 10:40pm On May 04, 2017 |
dhtml18:Your opinions are welcome |
Programming / Re: An Online Compiler, Interpreter And IDE For Nairaland by stealthtiger(m): 1:10pm On May 04, 2017 |
dhtml18:I'm deeply humbled. I'm just for 'give-the-job-to-the-best-man' idea |
Programming / Re: Where Are The Mods? by stealthtiger(m): 12:56pm On May 04, 2017 |
SetrakusRa: Exactly. Things that do not pertain to what this section stands for shouldn't be condoned. I'm very sure that what's going on here isn't was Seun planned. As a matter of fact Mr. Seun nairalands programming section even nairaland as a whole is in a statement of emergency. The mods are not doing their jobs therefore they need to be relieved of their duties. Then let someone who knows what it takes and is in tune with the philosophy of the section moderate. If nothing is done. Nairaland might just fully become a shadow itself that it becomes filled with bad posts. I think this is the last opportunity Seun has to bring sanity here, now that people are talking. 2 Likes |
Programming / Re: Where Are The Mods? by stealthtiger(m): 12:55pm On May 04, 2017 |
L |
Programming / Re: An Online Compiler, Interpreter And IDE For Nairaland by stealthtiger(m): 12:32pm On May 04, 2017 |
dhtml18:Wow. I'd be so happy if I'd be given the mandate. Things really need to be corrected. Nairaland programming section can also be a stackoverflow in it's own right |
Politics / Re: "Stop Exploiting Buhari’s Ill Health" - Northern Group Tells Yoruba Leaders by stealthtiger(m): 10:03am On May 04, 2017 |
kinibigdeal:Savage. That'who you are 1 Like |
Politics / Re: "Stop Exploiting Buhari’s Ill Health" - Northern Group Tells Yoruba Leaders by stealthtiger(m): 10:03am On May 04, 2017 |
kinibigdeal:Savage. That'swjo you are 1 Like |
Programming / An Online Compiler, Interpreter And IDE For Nairaland by stealthtiger(m): 9:36am On May 04, 2017 |
Nairaland needs an online programming environment. This is needed to facilitate learning and make things easier for us. Like for those hat need to post a problem and need an urgent solution to the answer. Even especially for people like me that are running tutorials. You can check it out athttps://www.nairaland.com/3776675/learn-python-introduction-programming. Trust me I know how difficult it is to type a Python code on nairaland code so that it looks the same way on a Python interpreter especially those 3 chevron's, the color and the rest, just to make it look real and everything. Trying to select the color, input the >>> sign takes a lot of time. All these problems can be solved if we have a compiler, interpreter and an IDE. So as we are coding or giving out solutions, it looks real like we're coding locally on our PC without making any modifications and we get to see the code run. So Seun give us a programming environment in the programming section at least for the major languages. PS: please ban people that are ruining this section with irrelevant material. It's just so sickening and it's defeating and riddling this section of it's purpose. |
Programming / Re: Learn Python- Introduction To Programming by stealthtiger(m): 9:18am On May 04, 2017 |
3. Conditional statements First of all let's talk about Boolean and Comparisons. Boolean statements are basically Yes or No statements. True or False >>> 5 ==5 True >>> 6 == 7 False So it's either true or false. == is a relational operator. We're going talk about that in a bit. >>> (type True) <type 'bool'> There are different relational operator's and we've seen one which is ==. There rest are x > 5 => x is greater than 5 x < 5 => x is less than 5 x != 5 => x is not equal to 5 x >= 5 => x is greater than or equal to 5 x <= 5 => x is less than or equal to 5 x == 5 => x is equal to 5 BEWARE: x == 5 is different from x = 5. The former is a relational operator and the latter is an assignment operator. It assigns 5 to x. 5==5 The two values on the left are right are called operands. L-operand and r-operand. LOGICAL OPERATORS: There are 3 types of logical operators in Python. And, Or, Not. AND >>> 7==7 and 4>1 True >>> 6 < 1 and 4 <2 False In the and operator the two sides should be true for the statement to be True. If one is true and the other is false as in the second example it returns False. OR n%2 == 0 or n%3 == 0 is true if either of the statements is true. So if one is true and the other is false. It stills returns True as long as one is true. NOT This basically negates a Boolean statement. Eg >>> not 1 == 1 False >>> not 7!=8 False >>> not 8 > 100 True So not takes a true statement and makes it false, a false statement and makes it True. CONDITIONALS: One capability computers have which is very useful us their ability to make decisions after giving them a set of instructions. In Python you can also arm your program with the ammo of decision making capabilities. So there might be a condition that need to to occur before the computer does something. For example: A lecturer might tell a class rep that until the class has may be say 70% attendance before I come to lecture. So the lecturer has given a condition. Until that condition is met before the lecturer comes to class. I know no one wants that kind of lecturer to take that crazy 4 units course. So let's start with the IF statement Out of all conditional statements the IF execution is the simplest. >>> if x>5: print ('yes') This means that the code in the indented block should display 'yes' if x>5. We can have an alternative form of execution to the if called ELSE >>>if x % 2 == 0: print('even number') else: print ('odd number') Python understands that if x modulo 2 isn't zero then it's odd. So it leaves the if statement and executes the indented code at the else statement. NB: X%2 is a way of checking if a number is even or odd. Since all even numbers are divisible by 2 without a remainder. 1 Like |
Programming / Re: Why Are Most Nigerian Programmers Interested In Web Development? by stealthtiger(m): 7:50am On May 04, 2017 |
Most Nigerian programmers are lazy. That's just the answer. You see it reflect in their works. They feel web development is easier compared to the lots of logic and theories of computing that'd be needed for software development. Nobody wants to learn. Everybody just wants to make a quick buck from this. But that's not how it should be. That's why you see when you give them jobs that are a bit deviated from web programming, and that also require deep skills in computing. What they do is to just apply that idea they have in web development for a complex program. Holy Shit! . At the end of the day they create mediocre products and that's the reason why software jobs are been outsourced to foreigners. It all boils that to laziness and mediocrity. They're not just willing to grow. So they just stick to the easiest shit and they're not even improving. Checkout nairalands app 4 Likes |
Programming / Re: Learn Python- Introduction To Programming by stealthtiger(m): 3:13pm On May 03, 2017 |
2. Numerical Operations In Python there are different Numerical Operations and we're going to talk about them. 1. Simple operations: >>> 1 + 2 + 8 11 >>> 5+4-3 6 >>> 2*(3+4) 14 >>> 10.0/2 5.0 Dividing a number by zero in Python produces an error >>> 10/0 Traceback(most recent call last): ZeroDivisionError: division by zero More on operations Exponentiation: To raise a number to a power supply denoted by x**2 in Python. >>> 2**2 4 >>> 8-(2**2 + 1) 3 Quotient and remainder: In Python quotient and remainder are denoted using the floor and modulo sign respectively (// and %) >>> 13//5 3 >>> 7//5 1 From the above example it can be inferred that the quotient is the number of times a divisor can divide a number. >>> 8%6 2 >>> 100%10 0 So the remainder is remaining value you get after dividing a number I hope we beginning to get a hang of python. Please feel free to ask questions. So let's talk about inputs and outputs in Python. To get data from your user would require you to provide a means to get data from the user. So you do this using input. >>>my_name = input('Enter your name: ') Enter name: So the input statement tells Python to get data from the user. And don't forget. Input statement accepts only string values. Buts there's a way to solve that by doin this >>>my_age = int(input('Enter age: ')) Enter age: Here, we told Python to only accept an integer. So if the user inputs a string, python would throw an error saying it can only accept an integer. Output If you can scroll upwards you'd notice that we've been using a function called PRINT. This print is used to output a statement in Python We should also note that's it's possible to convert types in Python. >>> my_age = '19' >>> you_age = '17' >>> total = my_age + your_age >>> print(total) 1917 int('3')+ int('4') 7 float('6')/float('6') 1.0 Python has the capability of converting an integer into a string by just using a single or double quote. '19' is no longer 19 as a number, instead it's now a string that's why '19'+'17' is 1919. NB: it's better to use a double quote when declaring q string. So we'd be using a double quote henceforth when we are dealing with strings. We can still convert that string to an integer by using an int function. The same thing applies to float. NB: not everything can be taught. So please try out things yourself because that's the best way to learn . Keep on experimenting and you'd see that they're lots of ways to do task even more simple and elegant ways that'd make a fellow programmer say 'wow' 1 Like |
Programming / Re: Learn Python- Introduction To Programming by stealthtiger(m): 2:43pm On May 03, 2017 |
promisedeco:Cool to hear from you. I really thought people were not interested. But you commenting gives me more morale to continue. I hope my tutorials would be of great help to you |
Programming / Learn Python- Introduction To Programming by stealthtiger(m): 8:45am On May 03, 2017 |
Hi to everyone who opens this thread. I'm Emmanuel Olatunde Bashorun and I'm 19 years also an undergraduate of the Univerisity of Lagos, and I love coding. I'm so glad you're here and I'm assuming you're here to get a basic understanding about Python. For those asking what language should I learn first let me give it to you bluntly and authoritatively learn Python if you want your life to be easier as you brave through the jungle of coding. I say Python because that's the best way to learn programming Thank me later What's Python; Python is a high level language created by Guido Von Rossum in the late 1980's. It has an efficient high level data structure and a simple but effective approach to object oriented programming. Python's elegant syntax and dynamic typing together with its interpreter makes it an ideal language for scripting and rapid application development in many areas and on most platforms. Python is used in big multi organizations for software development and data management, Artificial Intelligence(on which lies my intrest). Its popular in companies and gorvernment organizations like CIA, disney, Google, Yahoo, Instagram, NASA, CERN etc. Why learn programming: Programming is a skill which would determine your employability in the future in whatever field you're in. This is due to the increasing complexity of machines that'd be built and task's that needs to be solved. Let's say a sociologist is doing a Social computing test on Facebook and needs to know the most used words in a series of posts. Let's say 1million posts. It'd be so difficult but not impossible for the Sociologist to carry out that manually. It'd take a lifetime to get the required info from that task. So if the person had a basic idea of programming say Python, within a couple of minutes the Sociologist would have written a program that solved that task elegantly. In essence, you don't have to be a computer scientist to learn programming. After all the purpose of this tutorial is not to make you an accomplished Python developer but give you the required knowledge in getting started with python and doing some really incredible stuffs. At least it'd be a launch pad to lift your self into levels that will make you an accomplished Python developer. The version of Python that would be used in this tutorial is version 3.4.5. You can download and install Python on your PC as www.python.org. CPython is the flavor of Python we'd be coding with. Interpreter: Computers don't understand the normal language we speak so we have to communicate to them in a way they understand which is zero and ones called machine language which is represented by the switching on and off of the electrical circuits in the computer's memory. But it's difficult to write a string of zeros and ones telling a machine to get data from a user, process it and send it to the server which then gives any one who requests for it. Only a few people can do that now. So how do we go round this problem. A high-level language is needed of which we understand . High level languages are good because they require a shorter amount of time to write a program, they're portable, meaning they can run on different computers without modifications unlike machine language written on an Intel x84 based PC which has to be rewritten to run on an Intel x64 based PC. Two programs process high level languages into machine language. 1. Interpreter 2. Compiler The interpreter reads a high level language and executes it. It processes a program little at a time. Alternatively reads the code line by line and performing computations. The compiler reads the whole program and translate everything before it starts running. In context the high-level program code is called SOURCE CODE and the translated code is called OBJECT OR EXECUTABLE CODE. What is a program: [/b]A program is a series of instructions that tells a computer how to perform a computation. [b]Tutorial Outline: 1. Variables, expressions and statements 2. Numerical Operations 3. Conditional statements 4. Functions 5. Loops 6. Strings 7. Dictionaries 8. Tuples 9. Files 10. Exception handling PLEASE AND PLEASE NOTHING SHOULD BE POSTED ON THIS THREAD THAT IS OUT OF CONTEXT OF IT'S CONTENT AND THAT HAS THE ABILITY TO DERAIL THIS THREAD OF IT'S PURPOSE OTHERWISE A BAN WOULD BE GIVEN TO SUCH INDIVIDUAL. Contextual and related contributions are welcome. I'd be pleased if my errors can be pointed out during the cause of this tutorial since no one is perfect. Every example that'd be given here has been tested. But self testing the examples is highly encouraged to see if it truly works and also to increase the rate of learning. Before we get started let me leave you with one of my favorite quotes 'every skill you acquire doubles your odd of success' Scot Adams. So at least we have a basic idea of what python is. So it's time to start getting our hands dirty in code. 1. Variables, Expressions and Statements Let's hink of variables as containers. They hold values. Variables in python are capable of holding different datatypes. Data types are types of data. In python there are different data types such as int(integers=>they hold decimal numbers), float(floats=> numbers that contain decimal parts eg 8.76), str'(=> they are characters made up of a string of text eg 'good', 'Hello') there are other datatypes but we'd talk about them later As I said earlier on that variables hold values. Just like a jug holding some water or juice. Water andjuice are different types of liquid. You don't have to tell the jug what substance your filling it with. It just holds it for you. Same way with python. Python is an untyped language meaning you don'thave to specify to Python what type of value you're storing in the variable. Eg. >>> python = 'language' >>>print(python) >>>language From the above example you can see that I didn't have to tell python what type of variable language is. Python automatically new that it's a string. Check this out to confirm my statement above >>>type('language') >>>('type str') So Python's so smart that it knows 'language' is a string. This ability is due to the fact that Python has an in-built function called type[\b] In programming context storing a value in a variable is called [b]assigning a value to a variable. So we assigned language to python. Naming variables In Python a variable name can not start with a number. That's an illegal variable name. A variable name can contain an underscore, lower case, upper case. You can't use a key word as a variable name. There are about 31 keywords in python (reserved words) I strongly advise you to start your variable with a small letter. >>>7_wonders= 'pyramid of Egypt' SyntaxError: invalid syntax >>> my_name = 'Bashorun' >>> >>> print = 'print is a keyword' >>> SyntaxError: invalid syntax Operator's: These are symbols used to perform numerical operations like addition,subtraction, multiplication, division. Expressions: An expression is a combination of values, symbols and variables, operator's 16+2, 18-9 are expressions. Statements: A statement is a unit of code that a python interpreter can execute. Eg print statement and assignment statement. Statements do not contain values while expressions do. In Python there are different ways in which you can write your code. Either in the interactive mode or script mode. Interactive: You write directly in the interpreter thereby make the interpreter execute your code line by line. >>> pizza = 2.0 >>>people = 8.0 >>>shared_pizza = pizza/people >>>print(shared_pizza) >>>0.25 So you can see that Python keeps track of every line in the interactive mode Script: in script mode each computation performed on a line doesn't show but it's actually calculated but doesn't display it's self until you tell Python to. The final answer would be displayed after running the program written in the editor. This is unlike the interactive mode where a result would be displayed for every computation performed on a line. A text-editor is usually used in script mode, and Python comes with that editor which also has a debugger. pizza = 2 shared = pizza * 8 After you run the code 16 would be printed on the IDLE interpreter. Order of Operations: PEMDAS P: Parentheses E: Exponentiation M: Multiplication D: Division A: Addition S: Subtraction The first Operation takes precedence over the succeeding operation in an expression . String operation: There are ways to manipulate string's both legal and illegal. 'school'/2 is an illegal operation. You can't divide a string 'school' * 2 is a valid operation which prints=> school school There's a technique in programming called CONCATENATION. This means you can add two strings together to give the sum of the two strings 'spam' + 'spam' = spamspam NB=> Anything enclosed in a single quote or double quote in python is called a string. Eg. '32' is a string. Since it's in a single quote python doesn't regard it as an integer Comments As you write complex programs, you'd need to know what a certain function does or what a certain variable stores just to remember. You'd be surprised 6 months later that you wouldn't be able to recognize your own code. So this is where the comments shines. A comment is created by using a # sign #my_name is a comment which stores Bashorun my_names = 'Bashorun' When you run the following code, the python interpreter ignores the line that starts with a # 7 Likes 2 Shares |
Food / Re: How Many Plates Would You Eat In This Situation? (pic) by stealthtiger(m): 4:49pm On Apr 30, 2017 |
What is nairaland turning into. How can the mods move useless poststo the front page when there are highly educative posts that need to be shared. I think it's high time I reduce the amount of time I spend on this site. |
Romance / Re: 10 Signs An Introvert Is In Love With You by stealthtiger(m): 2:58pm On Apr 29, 2017 |
missyadorable:The pu$cy is always an introvert? |
Romance / Re: 10 Signs An Introvert Is In Love With You by stealthtiger(m): 2:56pm On Apr 29, 2017 |
Nomfanelo99:Oh my gosh. You pretty.. |
Family / Re: That Past Experience(s) That Made You Smile Or Laugh Out Loud. by stealthtiger(m): 8:37pm On Apr 25, 2017 |
Ishilove:No sodeinde is still under renovation. Those guys thats make sodeinde lively are now in biobaku. Hence the fun in biobaku |
Family / Re: That Past Experience(s) That Made You Smile Or Laugh Out Loud. by stealthtiger(m): 12:13pm On Apr 23, 2017 |
Ishilove: Eyin awon makama. Sodeinde boys and our cuss were still going on until about last 2 year they sent us packing for renovation. You can't just imagine how unlively new hall is now. Devoid of those activities that make it the center of Unilag all dues to the absence of Sodeinde boys. Na Biobaku dey hot now |
Education / Re: Nigerian Lecturers Are Still Using Old Methods To Teach - NACOSS President by stealthtiger(m): 10:52am On Apr 21, 2017 |
SIRmanjar:Ah. Why this. why are you making a hasty generalization concerning their intellectual capabilities just because of the challenges they're facing. I'm a southerner but I don't support what you've said. They've also produced great people who are recognized in their respective fields all over the world. Please next time make your comments more enlightening instead of writing a thoughtless string of characters plagued with sarcastic, awful and derogatory remarks that spur hate and disrespect. #RadicalRevolutionary |
Romance / Re: What Getting Married As A Virgin Does Not Guarantee by stealthtiger(m): 3:23am On Apr 19, 2017 |
corpersforum:Olosho |
TV/Movies / Re: BBNaija: Governor Dickson Campaigns For Bisola With Billboard (Photos) by stealthtiger(m): 4:00pm On Apr 03, 2017 |
Please can someone give this man a vasectomy. His testosterone is being secreted at an abnormal rate |
Celebrities / Re: Davido Receives Condom From D.J, Ecool As South African Lady Twerks For Him by stealthtiger(m): 8:43am On Apr 02, 2017 |
Nonsensical 8 Likes 1 Share |
Jokes Etc / Re: Girl Pranks Mother On April Fool's Day by stealthtiger(m): 6:48pm On Apr 01, 2017 |
Lol 3 Likes |
Politics / Re: Nigeria: Buhari Administration Sets New Record, Releases N1 Trillion For 2016 Ca by stealthtiger(m): 2:48pm On Mar 27, 2017 |
psucc:Poster, How am I singing Buhari’s praise. So because I posted this it now invariably means I'm a pro Buhari supporter... Smh |
Politics / Nigeria: Buhari Administration Sets New Record, Releases N1 Trillion For 2016 Ca by stealthtiger(m): 11:14am On Mar 27, 2017 |
Money released for capital projects to federal ministries, departments and agencies, MDAs, from the 2016 budget, have surpassed a record N1 trillion, the Minister of Finance, Kemi Adeosun, has disclosed. Mrs. Adeosun described the achievement as the highest ever budgetary release in Nigeria's annual funding for capital projects. "So far, N1trillion has been released on capital allocations. This is the highest so far in the history of this country," the minister said. "With the current stability in (crude) oil prices and the return of normalcy in Niger Delta, I am sure we will do more this year (2017)," she said. The Minister disclosed the figures in an interactive exchange with members of the House of Representatives Tactical Committee on Recession in her office in Abuja. She said the amount was released for various projects proposed in the 2016 budget, including the commencement of the construction of a dual standard railway line that would link Lagos and Kano, rehabilitation of roads, expanding irrigation facilities to boost agriculture and the upgrading of aviation infrastructure throughout the country. Details of the releases, the minister explained, include aggregate releases to the MDAs of N870.1billion as at the end of February 2017 and additional releases of N65.4 billion. Other releases included manual authority to incur expenditure (AIEs) in February 2017 (N11.18 billion) and an additional manual AIEs worth N45.8billion as at March 13, 2017. Mrs. Adeosun noted that the overall capital releases totalling N992.4 billion had significantly impacted the country's economy, by creating jobs, stimulating economic activities in communities and upgrading infrastructure, thereby improving the wellbeing of Nigerians. She said contractors returning to project sites around the country have employed workers, contributed to economic growth and improved the wellbeing of Nigerians in line with the strategic objectives of the present administration. "We are determined to transform the economy. This is why we are focused on capital expenditure. If we have our rails, road and power, then we will be able to generate jobs and prosperity," she said. The release of the capital vote in the budget is in line with government's drive to devote more resources for the execution of capital projects, especially the upgrade of the country's infrastructure to provide the enabling environment for investment in the economy. The Executive Council of the Federation in its meeting on March 22, 2017 had approved the reconstruction of 12 more major highways across the country for N80 billion as part of efforts to boost transportation in the country. http://allafrica.com/stories/201703270027.html
|
Crime / Re: Lagoon And Its Mystery. by stealthtiger(m): 9:57am On Mar 27, 2017 |
OP your topic is out of context and grossly misleading. You're also part and parcel of the people that constitute what you wrote about |
Travel / Re: Why Nigerians Are Refused Entry Into The U.s by stealthtiger(m): 3:35am On Mar 27, 2017 |
Quite true |
Science/Technology / Re: A Rural African Village Girl To Go To Mars In A Spaceship Built in Africa by stealthtiger(m): 3:27am On Mar 27, 2017 |
If you can dream it, then you can do it 1 Like 1 Share |
Celebrities / Re: Olajumoke, Patoranking, Clarence Peters & Toofan Pictured Together by stealthtiger(m): 8:27pm On Mar 24, 2017 |
jesusson22:Industry bitc*h |
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (of 11 pages)
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 105 |