Hirdetés
-
PROHARDVER!

Új hozzászólás Aktív témák
-
Zola007
veterán
Ezt meg lehet rövidebben vagy kevesebb változóval oldani (Perl 5.24)?
#!/usr/bin/perl -w
# Write a program that switches two bases in a DNA string at specified positions.
# Get the name of the file with the DNA sequence data
print "Please type in the sequence need to be modified: ";
$DNA = <STDIN>;
# Remove the newline
chomp $DNA;
# Get the base would like to change
print "Please type in which positions would like to switch?\n";
print " This position: ";
$pos1 = <STDIN>;
print "\n to this one: ";
$pos2 = <STDIN>;
# Remove the newline
chomp $pos1;
chomp $pos2;
# detect the bases at given positions to be modified
$base1= substr $DNA,($pos1 - 1),1;
$base2= substr $DNA,($pos2 - 1),1;
# change the bases among each other
$swap = substr $DNA,($pos1 - 1),1,$base2;
$swap = substr $DNA,($pos2 - 1),1,$base1;
print "The modified sequence is ",$DNA;
exit;
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
- Ryzen 7700X / RTX 4070 Ti Super / 32GB DDR5 / 1TB NVMe / 800w GOLD! BeszámítOK
- Samsung Galaxy A21s 128GB, Kártyafüggetlen, 1 Év Garanciával
- BESZÁMÍTÁS! Gigabyte B450M R5 5500 32GB DDR4 512GB SSD RTX 3060 12GB Rampage SHIVA Chieftec 700W
- Eladó egy soundcore boom 2 se
- BESZÁMÍTÁS! ASUS DUAL MINI RTX 3060Ti 8GB videokártya garanciával hibátlan működéssel
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


