Posts

Showing posts from February, 2024

Underrated step for logic building in programming.

Image
Logic building is a crucial and complex skill in programming. In essence, it is ability to come-up with solution of coding problem and write precise instructions ( or code) that a computer can execute autonomously. This skill requires aligning your thought process with computer and its capabilities. And running through code some-what abstractly to know and predict the behavior of code before it is executed. To be able to do this, one essential step that many beginner programmers overlook is performing dry runs. Understanding Dry Runs The concept of a dry run in programming is straightforward: can you mentally execute your code and predict its output without actually running it on a computer? While this seems simple, it is a challenging task. Typically, we are taught to write code, run it, and observe the output. This cycle is essential because code needs to run to be validated. However, if you rely solely on running your code to understand its behavior, you may struggle with building

Python code # 15 'classes'

  class Student: def __init__ ( self , Roll: int , name: str , faculty: str ): self .__Roll = Roll self .__name = name self .__faculty = faculty def display ( self ): print ( f"Student( { self .__Roll } , ' { self .__name } ', ' { self .__faculty } ')" ) def set_Roll ( self ,Roll): self .__Roll=Roll def set_name ( self ,name): self .__name= name def set_faculty ( self ,faculty): self .__faculty = faculty def get_Roll ( self ): return self .__Roll def get_name ( self ): return self .__name def get_faculty ( self ): return self .__faculty c = Student( 2 , 'nn' , 'lk' ) c.display() # Output: Student(2, 'nn', 'lk') print (c.get_name()) c.set_Roll( 42 ) c.display() # Output: Student(42, 'John', 'lk') --------------------------------------------------------------------------------------------- class Studen

Popular posts from this blog

Building JavaScript Array Methods from Scratch in 2024 - Easy tutorial for beginners # 1

Build eisenhower matrix with React, firebase and neumorphism ui . (Part one)

Creating a Dynamic Search Bar in React: A Step-by-Step Tutorial