Summary of the text
Write a function that receives a text and returns the first 100 characters with "..." if the text is longer than 100 characters. Otherwise it will restore the whole text unchanged.
Write a function that receives a text and returns the first 100 characters with "..." if the text is longer than 100 characters. Otherwise it will restore the whole text unchanged.
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
import math as m def matn(m): # Check whether the text is 100 characters if len(m) >= 100 : return m[:100] + "..." else : return m matnvorodi=input('matn morede nazar ra vared konid:') print(matn(matnvorodi))
def short(x): if len(x) > 100: b = x[:100+1] + '...' return b else: return x txt = input('text: ') print(short(txt))
def short_passage(passage): if len(passage) > 100: shorted_passage = passage[0:100] return shorted_passage else: return passage def main(): passage = input("please Enter your passage: ") editted_passage = short_passage(passage) #print("«" + editted_passage + "»" ) print(f"«{editted_passage}»") if __name__ == "__main__": main()
def short_String(string): if len(string) > 100: return string[0:100] + "..." else: return string num = input('string: ') print(short_String(num))
def matn(): str = input("please enter a string: ") if len(str) > 100: print (str[0: 100], "...") else: print(str) print(len(str)) matn()
def text(t): if len(t) > 100: return t[:100] + "..." else: return t text(input("Enter :")) print(text)
def tix (tx): if len(tx)>10: return (tx[:10],'...') return tx d=input('tx:') print(tix(d))
Submitting answers is currently unavailable.
Write a program that receives a text from the input and, like the example below, prints from the first to the first point Enter: My name is amirhossein. I live in tehran. My name is amirhossein
Write a function that receives a word and changes each letter to its next letter in the alphabet. Then returned the result. Indeed: "A" turns into "B" "" B "becomes" C "" C "becomes" D "and ........
Write a program that receives a one -digit number from the input and finds the coefficient of smaller than 100 of those numbers and prints in the output
Write a class that receives rectangular length, width and height and calculates its area and volume using different methods
Write a function that receives a list of numbers and generates 2 lists for pair and individual numbers and prints in the output example ([1,2,3,4]) Output: [1,3] [2,4] [2,4]
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.