3

@3373_vaishnavi

Py.creating tuple no.

Python
1 year ago
tuple=("10","20","30","40","50","60","70") for x in tuple: print (x)

Py.creating tuple

Python
1 year ago
Thistuple=("white","green","black","yellow","pink") for x in Thistuple: print (x)

Py.ex.break statement

Python
1 year ago
i=1 while i < 6: print(i) if (i == 3): break i += 1

Py.ex.While loop

Python
1 year ago
i=1 while i<99: print(i) i+=1

Py.ex. Pass statement

Python
1 year ago
a=34 b=123 if b>a: pass

Py.ex. if_elif_else statement

Python
1 year ago
a=45 b=30 if b>a: print("b is greater than a") elif a==b: print("a and b are equal") else: print ("a is greater than b")

Py. Ex.in elif

Python
1 year ago
a=33 b=33 if b>a: print("b is greater than a") elif a==b: print("a and b are equal")

Py.syntax condition statement

Python
1 year ago
a = 23 b = 23 if b==a: print("b is equal to a")

.

PHP
1 year ago
<?php // Number of rows for the pattern $rows = 5; // Loop through each row for($i = 1; $i <= $rows; $i++) { // Print stars equal to the current row number for($j = 1; $j <= $i; $j++) { echo "*"; }

How to Update a dictionary

Python
1 year ago
thisdict={ "brand":"fort", "model":"ultra", "year":2024 } thisdict.update({"brand":car}) thisdict.update({"model":i5}) thisdict.update({"year":2023}) print(thisdict)

W.A.PHP CODE to get a botton in forms.

PHP
1 year ago
<?php if(isset($_Post['gender'])){ $gender=$_Post['gender']; echo"You selected:".$gender; }else{ echo"No option Selected."; }

Php reverse a string

PHP
1 year ago
<?php $str="25"; $reversestr=strrev($str); echo"The reversed string is:".$reversestr; ?>

For loop no.print 1 to 10

PHP
1 year ago
<?php for($i=0;$i<10;$i++) { echo "numbers :$i \n"; } ?>

Php program that takes a number as user input & displays it as output:

PHP
1 year ago
<?php if($_SERVER["REQUEST_METHOD"]=="POST") { $number=$_post['number']; echo"The number you entered is:".$number; } ?>

W.A.P.in php to reverse a string

PHP
1 year ago
<?php $str="Hello World"; $reversedStr=strrev($str); echo"The reversed string is:".$reversedStr; ?>

Create a cookie ex.4m

PHP
1 year ago
<?php setcookie("user","john",time()+3600,"/"); if(isset($_COOKIE['user'])){ echo"cookie'user' is set! Value:",$_COOKIE['user']; }else{ echo"cookie'user'is not set!"; } ?>

Count the no.of word in string,3m

PHP
1 year ago
<?php $text="Hello word from the php"; echo str_word_count("$text"); ?>

W.A.P.to display number 1-10 in sequence us for loop

PHP
1 year ago
<?php for($i=1;$i<=10;$i++){ echo$i." "; }

W.A.P find the velocity of the car(d/t)

PHP
1 year ago
<?php // Given values $distance_meters = 700; // Distance in meters $time_minutes = 5; // Time in minutes // Convert time from minutes to seconds $time_seconds = $time_minutes * 60; // Calculate velocity in meters per second $velocity_mps = $distance_meters / $time_seconds;

Calculating interest

PHP
1 year ago
<?php $principal = 10000; $interestRate = 10; $interest = ($principal * $interestRate) / 100; echo "The interest on ₹$principal at $interestRate% is ₹$interest."; ?>