Modi Coders

Modi Coders

  • Instagram
  • Facebook
  • Twitter
  • Blog
  • Contact
  • Find Largest number from a list given by user

    February 7, 2025
    Python

    i=int(input(“enter total numbers”)) c=[] for j in range(i): c.append(int(input(“Enter a number”))) print(c) d=max(c) print(d)

  • Program to Check if a Number is Even or Odd

    February 7, 2025
    Python

      python CopyEdit num = int(input(“Enter a number: “)) if num % 2 == 0: print(“Even”) else: print(“Odd”)

  • format specifiers in python

    February 5, 2025
    Python

    Format Specifiers in Python Python provides format specifiers for formatting strings, numbers, and other data types. These specifiers can be used with f-strings (f””), the format() method, or % formatting. 1. Integer Formatting Format Description Example %d or {} Integer (decimal) print(f”{100:d}”) → 100 %o or {:#o} Octal representation print(f”{100:o}”) → 144 %x or {:#x}…

  • write a python program to show usage of all data types in python

    February 4, 2025
    Python

    # Integer int_var = 42 print(“Integer:”, int_var, type(int_var)) # Float float_var = 3.14 print(“Float:”, float_var, type(float_var)) # Complex complex_var = 2 + 3j print(“Complex:”, complex_var, type(complex_var)) # Boolean bool_var = True print(“Boolean:”, bool_var, type(bool_var)) # String str_var = “Hello, Python!” print(“String:”, str_var, type(str_var)) # List (ordered, mutable collection) list_var = [1, 2, 3, “Python”, 4.5]…

  • what are different data types in python discuss in detail

    February 3, 2025
    Python

    Python has several built-in data types that help in storing and manipulating different kinds of data. Below is a detailed discussion of the various data types in Python: 1. Numeric Types Numeric data types store numbers and support arithmetic operations. a. int (Integer) Represents whole numbers (positive, negative, or zero). No limit on size (depends…

  • how to call upper method in python

    February 3, 2025
    Python

    The .upper() method in Python is used to convert a string to uppercase. Syntax: string.upper() Example Usage: text = “hello world” upper_text = text.upper() print(upper_text) # Output: HELLO WORLD Calling upper() on a variable: name = “Python” print(name.upper()) # Output: PYTHON Calling upper() directly on a string literal: print(“hello”.upper()) # Output: HELLO Would you like…

  • what is difference between c ,c++ and java ,discuss in detail

    September 9, 2024
    Java

    C, C++, and Java are three prominent programming languages, each with its own unique features and use cases. Here’s a detailed comparison of these languages across various aspects: ### 1. **Origin and Paradigm** – **C:** – **Origin**: Developed in the early 1970s by Dennis Ritchie at Bell Labs. – **Paradigm**: Procedural programming language. It focuses…

  • What are Labelled Loops in java?

    September 9, 2024
    Java

    In Java, labeled loops are a way to give a name (label) to a loop, allowing you to control the flow of execution in nested loops. This is especially useful when you want to break out of or continue a specific outer loop from within an inner loop. Labels are essentially identifiers that you place…

  • Literals

    September 9, 2024
    Java

    In Java, literals are specific values that are directly used in the code, and they represent constant values. Java literals can be categorized into several types based on the kind of data they represent. Here’s a breakdown of the different types of literals in Java: 1. Integer Literals These are whole numbers without any fractional…

  • Type Casting

    September 9, 2024
    Java

    In Java, type casting refers to the process of converting a variable from one type to another. This is necessary when you need to assign a value of one data type to a variable of another data type. Java supports two main types of casting: implicit (automatic) and explicit (manual). 1. Implicit Casting (Automatic Casting)…

Previous Page
1 … 4 5 6 7 8 9
Next Page
  • Instagram
  • Facebook
  • Twitter

Modi Coders